{"id":3718,"date":"2014-03-29T08:29:26","date_gmt":"2014-03-29T08:29:26","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/cocoa-touchiosnibiboutletrelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-03-29T08:29:26","modified_gmt":"2014-03-29T08:29:26","slug":"cocoa-touchiosnibiboutletrelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/cocoa-touchiosnibiboutletrelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"cocoa-touch,ios,nib,iboutletRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/6x6v2.jpg?s=32&amp;g=1\" \/><br \/>\nPeter Hosey<br \/>\niphone cocoa-touch mode silent<br \/>\nI would like to stop my application playing a sound if the user has switched the iPhone to silent mode. Where can I read that the phone is in silent mode? Is there some flag I can query? I noticed that some applications ignore the silent mode and some not, while I would have expected all apps to respect that silent is silent !! Any hints or input would be greatly appreciated. Thanks Al<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f46ca3a7e3b22a39e274c17d68fee992?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmorgancodes<br \/>\nobjective-c cocoa cocoa-touch json<br \/>\nIn java-land, there are a handful of useful libraries which will convert json strings to objects of matching type. The json libraries I&#8217;ve seen for cocoa simply create nested NSDictionaries and NSArrays. Is there a tool out there which will go the extra step of reconstituting whatever object type I want? So, for example, if I have a class called &#8220;Unicorn&#8221;, with a property &#8220;maneColor&#8221;, and I have json that looks like this:{&#8220;maneColor&#8221;:&#8221;silver&#8221; }I can automatically instantiate a Unicorn object wit<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/Jrn9D.jpg?s=32&amp;g=1\" \/><br \/>\nAndrew Johnson<br \/>\nobjective-c cocoa-touch core-data<br \/>\nWhen using CoreData, the following multi-column index predicate is very slow &#8211; it takes almost 2 seconds for 26,000 records. Please note both columns are indexed, and I am purposefully doing the query with &gt; and &lt;=, instead of beginswith, to make it fast:NSPredicate *predicate = [NSPredicate predicateWithFormat:@&#8221;airportNameUppercase &gt;= %@ AND airportNameUppercase &lt; %@ \\OR cityUppercase &gt;= %@ AND cityUppercase &lt; %@ \\upperText, upperTextIncremented,upperText, upperTextIncremented];<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/957200ad74569bba2822ccd091983456?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRob Keniger<br \/>\niphone cocoa-touch keyboard decimal nsdecimalnumber<br \/>\niPhone\/Objective-C\/Cocoa newbie here. Based on a number of posts on stackoverflow, I have cobbled together an IBAction that I&#8217;m using in a basic iPhone calculator app that I&#8217;m building. The IBAction works with the numeric keypad to allow entry of decimal numbers without having to enter a decimal point. I am trying very hard to adhere to the &#8220;use NSDecimal when dealing with currency&#8221; adage although I am finding it difficult to do so like so many others who have posted questions. I am making stead<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2f28f8c5faab1a18402920ed3fc43617?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\ncarexcer<br \/>\nios objective-c cocoa-touch admob chartboost<br \/>\nso after a week of attempting to load chart boost to my non-arc iOS app in Xcode, I&#8217;m gonna start asking some really silly questions. my code in my appdelegate is: (void)applicationDidBecomeActive:(UIApplication *)application {[[CCDirector sharedDirector] resume];Chartboost *cb = [Chartboost sharedChartboost];cb.appId = @&#8221;530dd707f8975c182ae2c691&#8243;;cb.appSignature = @&#8221;0d8726e69c911a182b0cefac4eca36f692355725&#8243;;\/\/ Required for use of delegate methods. See &#8220;Advanced Topics&#8221; section below.cb.delegate<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/W8pFF.jpg?s=32&amp;g=1\" \/><br \/>\nNathFur<br \/>\nobjective-c ios cocoa-touch<br \/>\nFinally yesterday I&#8217;ve got my UISearchBar working properly. Suddenly now I am facing another issue.When I navigate through the views, the navigation bar moves to the right and the same navigation bar appears again -&gt; same title and navigation button on the left. TableView stays unmoved.On the second click on navigation button, it yes, returns to the previous View.The annotation I am getting is: Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get cor<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1a6d3b0db3618140ff1fcf57cefc23a1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmvds<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/eb43aa9eadcfbaddad714f8a3bc175d8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDGund<br \/>\niphone ios objective-c cocoa-touch<br \/>\nIn one of my views in a navigation controller, I have a method &#8211; (void) loadAlert that gets the content of a web page, parses it, and places the relevant content on a UITextView. The method call is located in the viewDidAppear: section of my view controller. It works fine when the view first loads and when the view appears at all when navigated to.I also want this data load to occur when the app returns from background. As many Stackoverflow posts and other sources indicated, I put my method<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/65858f22983cc45fe7390683eb4807f4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nEchilon<br \/>\niphone cocoa-touch objective-c++ iso<br \/>\nI have an NSMutableArray in my class containing Ingredient objects. I want to check whether the name property of any of the ingredients matches a string, but I can&#8217;t get the syntax quite right.I&#8217;m really missing Linq and predictates.-(BOOL) hasIngredient:(NSString *)ingredientName{for (Ingredient *ingredient in ingredients) {\/\/if([ingredient isKindOfClass:[Ingredient class]]){if ([ingredient-&gt;name isEqualToString:ingredientName]) {return YES;}\/\/}}return NO; }<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/957200ad74569bba2822ccd091983456?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRob Keniger<br \/>\niphone objective-c cocoa-touch eventkit<br \/>\nI have a strange problem with EKEventEditViewController when using it with custom timezones. It behaves differently in two situations:Situation 1 &#8211; works fine:Launch app Create EKEventEditViewController to add new event with startDate = [NSDate date] New event start is displayed correctly (current time) Change default timezone with [NSTimeZone setDefaultTimeZone:otherTimeZone] Create EKEventEditViewController to add new event with startDate = [NSDate date] New event start is displayed correctly<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a88248f632c039340efa02505be355e5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAviD<br \/>\nmobile risk-management ios<br \/>\nBeing employed in the infosec field I would like to set a good example. However I also do not believe in sweating the small stuff and would like to maximize my productivity. My current workplace, while piloting byo devices, iPads etc does not yet have an enterprise iPad solution. I have a personal iPad that I would like to use to take minutes of meetings and to brainstorm via mindmaps. At previous places where this was not frowned upon, I have found it significantly better than writing on a phys<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/71bb9b543b69ec8dd5c59238697c6f2d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJaydles<br \/>\nios ios-6 iphone-5 maps<br \/>\nThe initial release of Apple Maps is&#8230; challenged with regard to business listings, and lacks transit directions.But most of the other apps Tim Cook suggested in his apology fail to solve the problem: the straight-up GPS nav apps lack transit directions and have mediocre POI data, and the webapps are slow and lack many of the features of the native ones.What&#8217;s the best workaround until Google releases an iPhone native app (likely months) or Apple&#8217;s databases catch up (likely years)?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d65a1f02d4eb835512474e48dad9375d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbneely<br \/>\niphone ios youtube<br \/>\nWhenever I try and log into the native Youtube app on my iPhone, it reports &#8216;Authentication Failed&#8221; even though the details are 100% correct. Here&#8217;s what I&#8217;ve done so far:Youtube.com accepts my username and password on both the desktop and iPhone web app. I&#8217;ve reset my Youtube password I get the same results over 3G or wifi (tried multiple networks, incl. Apple Store), so it is not my carrier or ISP blocking Youtube. A friend logged in with his account and the iPhone accepted it, so it isn&#8217;t sp<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a4a01b93e12da4528aa6caacfc95a885?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGuy<br \/>\niphone objective-c ios image-processing<br \/>\nI&#8217;m trying to combine two photos into one image (think a body with a hole in the face on top of a picture of a different person&#8217;s face). The top image has some semi-transparent pixels and some fully transparent pixels and I want to overlay it on top of a solid image.Here&#8217;s what I&#8217;m doing: I have a Context with the right size and I draw the bottom image on it, without any alpha (faceImage). On top of that I draw an image that has a transparent hole in it, with various levels of transparencies (co<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2773fb278535f8d2f0c193800a3b8e09?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndanielpunkass<br \/>\nios objective-c osx cocoa automatic-ref-counting<br \/>\nIn Apple&#8217;s documentation about ARC, they make a point of spelling out a problematic scenario in which ARC will generate a boilerplate temporary variable behind the scenes. Search on &#8220;The compiler therefore rewrites&#8221;:https:\/\/developer.apple.com\/library\/mac\/releasenotes\/ObjectiveC\/RN-TransitioningToARC\/Introduction\/Introduction.htmlThe gist of the warning seems to be that because the stack-based variable is &#8220;strong&#8221; and the by-reference parameter to the called method (performOperationWithError:) i<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/625875a82db1431b0b40ef88c684dcf0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSaamJB<br \/>\niphone objective-c ios<br \/>\nI have a UITableViewController that when a cell is pressed, I want the controller to pop itself, and then have the controller it pop&#8217;s to, push another view controller onto the stack.I am invoking this method because the popped-to viewController is the delegate of the tableViewControllerI am currently invoking this method with a delay on it, because otherwise, everything gets screwed up waiting for the animation to end. Doing it this way seems a bit hacky and seems to me like it would fail if so<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b9f81801b50ddbd023d2bf3ef5c03e91?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSteven<br \/>\nobjective-c ios oauth<br \/>\nI&#8217;ve been trying to get a basic OAuth interaction working without success. There are certainly similar questions already posed on SO, but most of them have no replies. I&#8217;m getting pretty desperate here, so I&#8217;m just going to start by posting my entire code:\/\/ OAuth parameters NSString *oauthNonce = [self genRandStringLength:20]; NSString *oauthSignatureMethod = [NSString stringWithFormat:@&#8221;HMAC-SHA1&#8243;]; time_t oauthTimeStamp = (time_t) [[NSDate date] timeIntervalSince1970];\/\/ generate OAuth signat<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b547cded492f7180435556fae1bd840f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRobin van Dijke<br \/>\nios core-data memory<br \/>\nI&#8217;m now stuck for about two weeks with a nasty Core Data problem. I read lots of blogpost, articles and SO questions\/answers but I&#8217;m still not able to solve my problem.I ran lots of tests and was able to reduce the larger problem to a smaller one. It&#8217;s going to be a large explanation so keep with me!Problem &#8211; datamodelI have to got following datamodel:Object A has one-to-many relation with object B which has another one-to-many relation with object C. Because of Core Data recommendations I have<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e16a46d894cafe9a1495ec6f83849d2c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNate<br \/>\nios uiwebview uiscrollview uikit<br \/>\nThe QuestionDoes anyone know of technical reasons for avoiding web views inside scroll views on iOS (assuming you&#8217;re willing to disable scrolling inside the web views themselves)?If you look at the Apple docs for UIWebView, they state:Important: You should not embed UIWebView or UITableView objects inUIScrollView objects. If you do so, unexpected behavior can resultbecause touch events for the two objects can be mixed up and wronglyhandled.My Educated GuessIt looks like maybe they&#8217;re warning you<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/81d2c0d1e169fccb63893706ef70db19?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrmaddy<br \/>\nios uitabbarcontroller<br \/>\nThis question already has an answer here:Proper way to exit iPhone application?19 answersI have a tab based app, which last tab button is &#8220;Exit&#8221; how can I quite iPhone App, on click of that last tab bar?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/Qc2Pb.jpg?s=32&amp;g=1\" \/><br \/>\nJohn Woods<br \/>\nios objective-c cocoa-touch nib<br \/>\nI have noticed that when adding a viewController with interface builder and a nib,That I don&#8217;t have to call initWithNibName for it to pick up the associated nib, I can just call init!Any idea why?ie.This:NotificationManagementController *notificationView = [[NotificationManagementController alloc] initWithNibName:@&#8221;NotificationManagementController&#8221; bundle:nil andCurrentNotifications:nil];and This:NotificationManagementController *notificationView = [[NotificationManagementController alloc] init]<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/90d1c6fd3b4245be0a015cb7ac9abb8f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrmvz3<br \/>\ncocoa interface xcode4 interface-builder nib<br \/>\nI have a nib in my Mac app that includes a few image views. Theese images make me difficult to edit the controls layered behind them or even check their position. I know I can check the Hidden property and make them semitransparent but I&#8217;d prefer just hide them momentarily (from the IB, not in runtime) as I do when work in any design program.Is there any way to do this?. Am I missing something?.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/df887034da4e7de1309111c7f06c5523?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser512530<br \/>\ncocoa osx nib nsbundle<br \/>\nI&#8217;m developing on an older Mac. I don&#8217;t have access to newer Macs running Xcode 3.1, but I want to make sure my sourcecode will work on them. It&#8217;s been pretty easy so far, all I have to do is ignore anything with &#8220;deprecated&#8221; next to its name, but the change from NIBs to XIBs has me kind of tripped up. The things I&#8217;ve read seemingly imply that XIBs get compiled into NIBs during a Release build, but maybe they don&#8217;t during a Debug build. What would this do in Xcode 3.1?#import &lt;Cocoa\/Cocoa.h&amp;g<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e5c9565768347463aecb151cc12b0db7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMarcel Hansemann<br \/>\nobjective-c cocoa nib nsdocument nsbundle<br \/>\nI have a document-based Cocoa app. During runtime, I load an additional nib from the bundle by invoking [NSBundle loadNibNamed:@&#8221;inspectorNIB&#8221; owner:self] (where self is the NSDocument).Strangely enough, while loading the bundle succeeds, it invokes the NSDocument&#8217;s awakeFromNib method again, causing an unnecessary second initialisation. Is this expected behaviour? How can I suppress it?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2c05d500ea02308bcc0e7f2990ac7520?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmilesmeow<br \/>\nios xcode nib<br \/>\nI have a nib file for the full version of the app. Buttons in that view are connected to functions in the view&#8217;s controller. I have two schemes (full version and lite version). Each one shares many files but have their own graphics files, etc. I also have #ifdef directives to include code for the lite version of the app.I want to create another version of the nib file for the lite version because there will be slight differences in the view&#8230;color changes, an added info button, additional text,<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1e21a1ef1c9efb2d669d8951c1d2a25a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBen Lings<br \/>\ncocoa-touch ios nib iboutlet<br \/>\nI have more than 20 labels that I need to update at runtime, and I was wondering if it could be possible to access them without having to declare properties and outlets for all of them. I tried to assign a unique tag to each, and access them trhough the view in my view contoller, something like this:self.view.myLabel1.text = @&#8221;Some text&#8221;;But it did not work. Is there a way to accomplish this?Thanks<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/77fd709e2756583da490164e9445958a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ngerry3<br \/>\niphone objective-c performance nib xib<br \/>\nI was wondering if there is a difference between using .xib files for GUI design and doing this programmatically.As it is a compiler I would assume that there is no relevant time lost.Am I wrong?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1a05ec6c2111713c2e4d429b90964ff1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser244129<br \/>\nios internationalization icons nib<br \/>\nI have 2 localized directories ca.lproj and es.lproj. Both own a nib MyNib.xib and an icon MyIcon.png. MyIcon.png is used in a custom button in the nib. Because MyIcon.png has a text in it, the actual image is different for each folder, with the text drawn in the correct language. I need each nib to embbed the correct icon.The problem is that if I open the nib in one lproj ( say the es.lproj ) and try to assign the icon to the button in IB, I can only see the icon that belong to the OTHER lproj<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/11a316cd82f7abd872ef02a0bd09810b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRobert Karl<br \/>\nios uitableview uitableviewcell nib<br \/>\nIs it possible to delete rows from a UITableView at runtime when all of the sections and rows are defined statically in a nib?In the following storyboard scene, can I delete the &#8220;Addr 2&#8221; field at runtime? In this case I have not provided a data source to the UITableView.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2bb115ad0fc9b20f1cc2a20f57774b40?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPiero<br \/>\niphone ios uitableviewcell xib nib<br \/>\nHello i have two Custom UITableViewCell nib, and i give the option to the users to choose what type of nib choose in the setting, i initialize the custom view cell in this way:- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {static NSString *CellIdentifier = @&#8221;MasterViewCell&#8221;;UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];if (cell == nil) {[[NSBundle mainBundle] loadNibNamed:[[NSUserDefaults standardUser<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/79f438a6844f77869a79854eb9404aae?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJosh Caswell<br \/>\nios xcode interface-builder ibaction iboutlet<br \/>\nI am using XCode 4.6.3 to try iOS &#8220;hello world&#8221; like applications. I am able to create actions for UI elements using CTRL+Drag. My question is, how does XCode track which method is associated with a certain element. There is no such indication in the ViewController.m.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/graph.facebook.com\/219001761\/picture?type=large\" \/><br \/>\nCasebash<br \/>\nobjective-c iboutlet<br \/>\nThe code generator Accessorizer has an option to assign IBOutlets rather than retaining them. For example, compare these two generated lines:@property(nonatomic,retain)IBOutlet UIImageView *backgroundView; @property(nonatomic,assign)IBOutlet UIImageView *backgroundView;Why would I want to assign IBOutlets, while retaining all other properties?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/96d23ca2ef5d13034bf07fd125e52544?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nzanona<br \/>\nobjective-c ios interface-builder iboutlet<br \/>\nsorry If am I being too picky on this one but I am learning iOS programming now and I&#8217;ve seem some people who declare the IBOutlet like this:IBOutlet attached to property#import &lt;UIKit\/UIKit.h&gt; #import &#8220;CustomCell.h&#8221;@interface CustomTableViewController : UITableViewController {CustomCell *customCell; } @property (nonatomic, retain) IBOutlet CustomCell *customCell; @endAnd some declaring like this:IBOutlet attached to the declaration inside the interface#import &lt;UIKit\/UIKit.h&gt; #import<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1e21a1ef1c9efb2d669d8951c1d2a25a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBen Lings<br \/>\ncocoa-touch ios nib iboutlet<br \/>\nI have more than 20 labels that I need to update at runtime, and I was wondering if it could be possible to access them without having to declare properties and outlets for all of them. I tried to assign a unique tag to each, and access them trhough the view in my view contoller, something like this:self.view.myLabel1.text = @&#8221;Some text&#8221;;But it did not work. Is there a way to accomplish this?Thanks<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1aeb7bfda3255406fcf3eb0e09b2bebc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nVincent Gable<br \/>\nxcode interface-builder compiler-warnings xib iboutlet<br \/>\nHow can I have Xcode warn me if an IBOutlet of one of my objects is not hooked up to anything in a NIB?I can check that outlets are connected at runtime by adding assert(ofEveryOutlet); in awakeFromNib or viewDidLoad. But it&#8217;s not as useful, or reliable, as having the compiler do the checking for me.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f9341836ce1cf04cd7e128e4c8b1db99?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nThinkingStiff<br \/>\nobjective-c xcode4 nsstring iboutlet<br \/>\nI have a UIView extended class which has an extra NSString property. For convenience I&#8217;d like to somehow set that property in the designer, if possible.@property (nonatomic,retain) IBOutlet NSString* designerAccessibleString;The property will show up as an Outlet as expected. I connect it to an NSString Object that was added from the Objects Library (added as Plain Object, class changed to NSString). But I&#8217;m unable to edit the string through the designer Attributes Inspector&#8230; is there a way?I<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/26a0d0fc41f718208f6f7d99c924f051?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\npcperini<br \/>\nxcode cocoa null iboutlet automatic-ref-counting<br \/>\nSo I&#8217;ve got an NSViewController (MyVC) set up like so:\/\/MyVC.h &#8230; @property (nonatomic, retain) IBOutlet NSTextField *input; &#8230;\/\/MyVC.m &#8230; @synthesize input;- (id)init {self = [super initWithNibName: @&#8221;MyVC&#8221; bundle: [NSBundle mainBundle]];NSLog(@&#8221;%@&#8221;, input); \/\/prints (null) alwaysreturn self; }- (void)loadView {[super loadView];NSLog(@&#8221;%@&#8221;, input); \/\/still (null) } &#8230;\/\/MyVC.xibCustom View [Referencing Outlet: File&#8217;s Owner.view]Text Field [Referencing Outlet: File&#8217;s Owner.inpu<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2e19cf3543cd496b28f3f65285625116?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJsdodgers<br \/>\narrays uiswitch iboutlet iboutletcollection<br \/>\nI&#8217;m using an IBOutletCollection of switches to set them disabled. After create the IBOutletCollection, I made a for cycle to set them disabled:for (arraySwitchCounter = 0; arraySwitchCounter &lt; _switchCollection.count; arraySwitchCounter ++) {UISwitch * disabledSwitch = [ _switchCollection objectAtIndex: arraySwitchCounter ];[disabledSwitch setEnabled: NO]; }but it crash on startup, I think trouble is on second row but I don&#8217;t know what&#8230;how can I solve? Thank you!<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/ZgBEk.png?s=32&amp;g=1\" \/><br \/>\nuser456584<br \/>\nobjective-c ios uibutton iboutlet<br \/>\nPossible Duplicate:UIAlertView crashes when added to app I recently tried to delete a UIButton outlet called myButton, but I&#8217;m thinking I must have missed something because I now get the following error:this class is not key value coding-compliant for the key myButtonIf I grep the entire project, there are no remaining references to myButton, so I&#8217;m not sure how to fix the issue.How does one get rid of this exception?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/55fce6b71ecc3dd186c3101fcfbebca8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nOlotiar<br \/>\nobjective-c ios variables uilabel iboutlet<br \/>\nI&#8217;m having trouble casting a string to exchange for an IBOutlet variable name in my code.I&#8217;m trying to reference an instance of an IBOutlet UILabel that was declared in the header file by programmatically creating the same variable name later on.However, when I cast an string to try &amp; substitute for the IBOutlet UILabel variable name, the program crashes.Hopefully, the example below explains what&#8217;s happening &amp; why needed. Sorry if the description is a little shaky &#8211; I&#8217;m a beginner.When<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Peter Hosey iphone cocoa-touch mode silent I would like to stop my application playing a sound if the user has switched the iPhone to silent mode. Where can I read that the phone is in silent mode? Is there some flag I can query? I noticed that some applications ignore the silent mode and some [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3718","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3718"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3718\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}