I'm new to Xcode and am trying to make a simple application where I enter a value hit a button and the value is passed to the next view and displayed. I am having trouble finding content on the internet on how to do this.  I created a Single View Application and another view controller, then connected them with a modal but cannot figure out how to pass values between the two.  Any pointers or good references would be awesome.
118989
Being new to objective-c, cocoa, and iPhone dev in general, I have a strong desire to get the most out of the language and the frameworks.  One of the resources I'm using is Stanford's CS193P class notes that they have left on the web.  It includes lecture notes, assignments and sample code, and since the course was given by Apple dev's, I definitely consider it to be "from the horse's mouth".  Class Website:   Lecture 08 is related to an assignment to build a UINavigationController based app that has multiple UIViewControllers pushed onto the UINavigationController stack.  That's how the UINavigationController works.  That's logical.  However, there are some stern warnings in the slide about communicating between your UIViewControllers.  I'm going to quote from this serious of slides:   Page 16/51:     How Not To Share Data         Global Variables or singletons         This includes your application delegate      Direct dependencies make your code less reusable         And more difficult to debug &amp; test         Ok.  I'm down with that.  Don't blindly toss all your methods that will be used for communicating between the viewcontroller into your app delegate and reference the viewcontroller instances in the app delegate methods.  Fair 'nuff.  A bit further on, we get this slide telling us what we should do.  Page 18/51:     Best Practices for Data Flow         Figure out exactly what needs to be communicated   Define input parameters for your view controller   For communicating back up the hierarchy, use loose coupling         Define a generic interface for observers (like delegation)         This slide is then followed by what appears to be a place holder slide where the lecturer then apparently demonstrates the best practices using an example with the UIImagePickerController.  I wish the videos were available! :(  Ok, so... I'm afraid my objc-fu is not so strong.  I'm also a bit confused by the final line in the above quote.  I've been doing my fair share of googling about this and I found what appears to be a decent article talking about the various methods of Observing/Notification techniques:   Method #5 even indicates delegates as an method!  Except.... objects can only set one delegate at a time.  So when I have multiple viewcontroller communication, what am I to do?  Ok, that's the set up gang.  I know I can easily do my communication methods in the app delegate by reference's the multiple viewcontroller instances in my appdelegate but I want to do this sort of thing the right way.  Please help me "do the right thing" by answering the following questions:   When I am trying to push a new viewcontroller on the UINavigationController stack, who should be doing this push.  Which class/file in my code is the correct place? When I want to affect some piece of data (value of an iVar) in one of my UIViewControllers when I am in a different UIViewController, what is the "right" way to do this? Give that we can only have one delegate set at a time in an object, what would the implementation look like for when the lecturer says "Define a generic interface for observers (like delegation)".  A pseudocode example would be awfully helpful here if possible.
72292
Hi I have the address of a property and my application can launch a browser to go to . If a good match is found it will take it directly there. Is there any thing I can append to the url to make it switch to streetview without having the exact coordinates? I dont't want to code any javascript or flash.
66114
I haven't found a similar question that already has an answer so I hope I can get one... Please forgive me if the answer is obvious. I'm using QGIS version 2.14.0-Essen on my macbook pro with OSX Yosemite 10.10.5. I am trying the simplest select features using an expression  Here is the window I get:  I right-click the field (e.g. here "DIVISION") and select say Load all unique values but nothing happens. I can check layer values beforehand and enter the correct value and it works (e.g. "DIVISION"='CENTRAL') but it's cumbersome.  So my question is: How can I get this unique values window to show?
107070
I'm currently displaying a UIViewController like this:  [[self navigationController] presentModalViewController:modalViewController animated:YES];   and hiding it like this:  [self.navigationController dismissModalViewControllerAnimated:YES];   The animation is "slide up from the bottom"... then slide back down.  How can I change the animation style?  Can I made it fade in/out?  Cheers!
97340
hi i'm trying to display a view in a popup but unable to get a solution. i tried   colorbox node module popup views integration module   Is there any better way to display a view as a popup ?
120233
I would like to be able to pass aarguments to operators that I am calling from panels/buttons but I do not know how to do that. At the moment I use "global" variables but they tend to make the code a bit like a puzzle since I need to constantly update them.  See the code below, in that example I would like to pass an argument (like ARG) to "object.simple_operator" when the button is clicked.  import bpy     def DO_SOMETHING(arg):      print(arg)  return  class SimpleOperator(bpy.types.Operator):     """Tooltip"""     bl_idname = "object.simple_operator"     bl_label = "Simple Object Operator"      @classmethod     def poll(cls, context):         return context.active_object is not None      def execute(self, context):         DO_SOMETHING(ARG)         return {'FINISHED'}    class MyPanel(bpy.types.Panel):      bl_label = "mypanel"     bl_idname = "OBJECT_PT_MyPanel"      def draw(self, context):          layout = self.layout          wm = context.window_manager          obj = context.object          row = layout.row()         row.operator('object.simple_operator')
2130
I have the following example class:  Test.h:  @interface Test : UIButton {     NSString *value; } - (id)initWithValue:(NSString *)newValue; @property(copy) NSString *value;   Test.m:  @implementation Test @synthesize value; - (id)initWithValue:(NSString *)newValue {     [super init];        NSLog(@"before nil value has retain count of %d", [value retainCount]);     value = nil;     NSLog(@"on nil value has retain count of %d", [value retainCount]);     value = newValue;     NSLog(@"after init value has retain count of %d", [value retainCount]);     return self; }   Which produces the following output:  2008-12-31 09:31:41.755 Concentration[18604:20b] before nil value has retain count of 0 2008-12-31 09:31:41.756 Concentration[18604:20b] on nil value has retain count of 0 2008-12-31 09:31:41.757 Concentration[18604:20b] after init value has retain count of 2147483647   I am calling it like:  Test *test = [[Test alloc] initWithValue:@"some text"];   Shouldn't value have a retain count of 1?  What am I missing?    Thanks for your help.
52267
I am trying to get key-value-observing to work for an NSMutableArray. Below is the .h file for MyObservee, the observed class:  @interface MyObservee : NSObject {     @private int someValue;     @private NSMutableArray *someArray; }  @property (readwrite,assign) int someValue; - (NSMutableArray *)someArray; @end   The class MyObserver implements observeValueForKeyPath:ofObject:change:context:. Here is how I add the observer:  MyObservee *moe = [[MyObservee alloc] init]; MyObserver *mobs = [[MyObserver alloc] init];  [moe addObserver:mobs        forKeyPath:@"someArray"           options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)           context:NULL];  [moe.someArray addObject:@"hi there"];   How come the addObject: message isn't triggering as a change to the someArray key path? I have a feeling there's something I don't fully understand here.
51969
I'm building a very small app that allows my users to post content to a map.  The home screen of the app contains a map with all of the posts (as seen below).  PROBLEMS  01 - if a user posts a post from the same area, two pins will be on top of each other so you won't be able to access one of them  02 - if a lot of content is posted it will be hard to click on each pin  03 - when you zoom all the way out, there will be too many pins  Can anyone recommend trying anything else please?
89752
Here is my scenario.  For the example lets say that I need to return a list of cars based on a search criteria.  I would like to have a single View to display the results since the output will be the same, but I need several ways of getting there.  For instance, I may have a Form with a textbox to search by year.  I may have another separate page that contains a hyperlink for all red, Toyota cars.  How do I handle these multiple scenarios in the same View and Controller.  My dilemma is that the search could contain several options… year, make, model, etc but I don’t know where to put them.  What is the best approach for this?  Should I define the parameters in the routing or go with query strings, etc?
12365
I am making an component in lightning. i want to know how can we use the state and county picklist in this particular code.  secoundly the functionality of save and cancel button is also not working in the lightning component.Help me out.  Thanx          &lt;div class="container"&gt;                     &lt;form class="formbusiness"&gt;         &lt;h1&gt;Account Information&lt;/h1&gt;         &lt;div class="row"&gt;             &lt;h1 class="headingB"&gt;Business Account Info&lt;/h1&gt;             &lt;div class="col-md-6"&gt;                 &lt;ui:inputText aura:id="b_cname" class="form-control" value="{!v.newBAccount.Name}" placeholder="Company Name" required="true"/&gt;                 &lt;ui:inputNumber aura:id="b_bphone" class="form-control" value="{!v.newBAccount.Phone}" placeholder="Phone" required="true"/&gt;                 &lt;ui:inputEmail aura:id="b_bemail" class="form-control" value="{!v.newBAccount.Email__c}" placeholder="Email"/&gt;             &lt;/div&gt;             &lt;div class="col-md-6"&gt;                 &lt;ui:inputText aura:id="b_bstreet" class="form-control" value="{!v.newBAccount.BillingStreet}" placeholder="Billing Street"/&gt;                 &lt;ui:inputText aura:id="b_bcity" class="form-control" value="{!v.newBAccount.BillingCity}" placeholder="Billing City"/&gt;                 &lt;ui:inputText aura:id="b_state" class="form-control" value="{!v.newBAccount.BillingStateCode}" placeholder="State"/&gt;                 &lt;ui:inputText aura:id="b_country" class="form-control" value="{!v.newBAccount.BillingCountryCode}" placeholder="Country"/&gt;                 &lt;ui:inputNumber aura:id="b_zipcode" class="form-control" value="{!v.newBAccount.BillingPostalCode}" placeholder="Zip Code"/&gt;             &lt;/div&gt;         &lt;/div&gt;         &lt;div class="row"&gt;             &lt;h1 class="headingB"&gt;Respective Contact&lt;/h1&gt;             &lt;div class="col-md-6"&gt;                 &lt;ui:inputText aura:id="b_rcfirstname" class="form-control" value="{!v.newBRCAccount.FirstName}" placeholder="First Name"/&gt;                 &lt;ui:inputText aura:id="b_rclastname" class="form-control" value="{!v.newBRCAccount.LastName}" placeholder="Last Name" required="true"/&gt;                 &lt;ui:inputNumber aura:id="b_rcmobile" class="form-control" value="{!v.newBRCAccount.MobilePhone}" placeholder="Mobile" required="ture"/&gt;             &lt;/div&gt;             &lt;div class="col-md-6"&gt;                 &lt;ui:inputEmail aura:id="b_rcemail" class="form-control" value="{!v.newBRCAccount.Email}" placeholder="Email"/&gt;                 &lt;ui:inputNumber aura:id="b_rcphone" class="form-control" value="{!v.newBRCAccount.Phone}" placeholder="Phone"/&gt;                                 &lt;/div&gt;         &lt;/div&gt;         &lt;div class="buttonB"&gt;             &lt;ui:button label="Save" press="{!c.createBAccount}"/&gt;             &lt;ui:button label="Cancel"/&gt;         &lt;/div&gt;             &lt;/form&gt;         &lt;/div&gt;
111151
Can I simply use  if(myString == nil)   For some reason a string that I know is null, is failing this statement.
119047
I'm making a very basic  type of game in JavaScript. I'm a beginner, so I'm just doing this for fun and learning, and due to bad planning I have run into a bit of a problem when you get to a branch in dialogue.  Currently I hold the script for the game in a string variable and I break up each scene with a tag such as "#~" into smaller arrays so that the game script looks like this:  var script = "Hello World!#~How are you today?" var gameText = script.split("#~"); //gameText[0]= Hello World!   This works great for linear stuff, but how should I handle a branch in the dialogue tree? This method seems very complicated, as I would have to know exactly how long each path is and then if I ever needed to change anything it would be a headache.  How can I do this in a simpler way? I'm trying to stick to vanilla JavaScript as I'd like the game to work with Web Run Time.
8549
I'm working on a Cocoa Mac app where I need to display a window/view on a secondary monitor, full-screen.  I know how to create a window that could be dragged onto the secondary monitor, but I was wanting to programatically create the window and make it full screen on the external monitor.  Thanks for the help.
94823
I am trying to create a button which will update a field value to null (RESET it). However, it's not working and not even giving any error. So when I click on the button, nothing happens.  lc.cmp:  &lt;aura:attribute name="myObj" type="Account" default="{'SObject':'Account'}"/&gt; &lt;lightning:input type="text" name="accountPhn" label="Enter Account Phone" value="{!v.myObj.Name}"/&gt; &lt;lightning:button label="Reset" onclick="{!c.resetMe}"/&gt;   lc.js:  resetMe : function(component, event, helper) {         //alert("Called");         component.set("v.accountPhn","");     }   Appreciate help around this.
114415
We are in process of converting our existing JS buttons to Quick Action + lightning Components.  There are some 2/3 buttons which do the same functionality with very little difference among them. For Example, Creating a case with subject field Test1 in buttonA, Test2 in button B, Test3 in button C.  So ideally i should have 3 quick actions with 3 components.  But since this is a very little change, i do not want to create another new component+controller and would like to reuse 1 component for all 3.   My Solution:  document.getElementsByClassName('modal-header slds-modal__header')[0].innerText   Using the above js code, i get the modal header name (which is nothing but the quick action label).  Finally based on the value from above js, i assign value to the field in sObject.  Is this correct approach or is there any predefined function which can be used for getting the quick action name?
93193
Trying to populate an lightning attribute if a single record exists and if multiple records exists would like to provide the user a select list to choose the record then set the attribute.  I cannot seem to get the lightning:select to get its value to be set:  Component  &lt;aura:component description="Account_Selection" controller="MyController"&gt;         &lt;!-- Handle component initialization in a client-side controller --&gt;         &lt;aura:handler name="init" value="{!this}" action="{!c.doInit}"/&gt;          &lt;!-- The list of accounts to display --&gt;         &lt;aura:attribute name="accounts" type="Account[]"/&gt;          &lt;lightning:select aura:id="a_opt" name="a_opt" label="Accounts"  onchange="{!c.onSelectChange}"&gt;             &lt;aura:iteration items="{!v.accounts}" var="account"&gt;                 &lt;option value="{!account.Id}"&gt;{!account.Name}&lt;/option&gt;             &lt;/aura:iteration&gt;         &lt;/lightning:select&gt; &lt;/aura:component&gt;   Controller  ({     doInit : function(component, event, helper) {         //console.log('here');         helper.getAccounts(component);     },      onSelectChange : function(component, event, helper) {         // Print out the selected value         var selected = component.find("a_opt").get("v.value");         console.log('@@@@@@@: ' + selected);     } })   Helper  ({     getAccounts : function(cmp) {          var action = cmp.get("c.getAccounts");          action.setCallback(this, function(response){             var state = response.getState();             if (state === "SUCCESS") {                 cmp.set("v.accounts", response.getReturnValue());                 cmp.set("v.accountId","ANIDTOTESTTHESET");                 var sel = cmp.find('a_opt');                 sel.set("v.value","ANIDTOTESTSETTINGTHEVALUE");             }         });          $A.enqueueAction(action);     } })   Now, the select DOES show the available select options but I cannot for the life of me get the value to be set via the code.   The above component is within a parent component as so:  &lt;c:Account_Selection aura:id="a_selection"/&gt;   The parent component has an attribute  &lt;aura:attribute name="accountId" type="Id"/&gt;   What I would like to happen:   If only one account record returned from the apex controller, set the value of the accountId attribute to the Id of that record If multiple accounts found, set the default value of the select list to a specific value and set the attribute value If user selects a value then set the value of the attribute   I have tried everything I can think of searched but cannot get it to work. The select list has all the options but the first value seems to always be selected regardless of the value I attempt to set.   The outPutText does not have any value despite explicitly setting it from the component..  Any ideas how to make this work?   Update  I think the issue is the "cmp" is not the lightning component it is the apex controller? How do i get a reference back to the component on the callback?