problem about iphone-sdk-5.0-Collection of common programming errors
Z S
uitableview uitableviewcell uikit iphone-sdk-5.0
I have always been setting the background of my UITableViewCell inside the cellForRowAtIndexPath call, like this:CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:simple];if (cell == nil) {NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@”CustomCell” owner:self options:nil];for (id findCell in nib ){if ( [findCell isKindOfClass: [CustomCell class]]){cell = findCell;} }UIView *cellBackView = [[UIView alloc] initWithFrame:CGRectZero];UIView *cellSelectedBackView
Johannes Lund
objective-c if-statement macros iphone-sdk-5.0
I’m curious why this code won’t work:#if UI_USER_INTERFACE_IDIOM//() == UIUserInterfaceIdiomPad @implementation UINavigationBar (Custom height)- (CGSize)sizeThatFits:(CGSize)size {CGSize newSize = CGSizeMake(self.frame.size.width,44+BreadCrumbBarHeight-1);return newSize; } @end #endifAny ideas?
Tilo Prütz
ios5 uilabel iphone-sdk-5.0
I have a class here that passes a String value to another class which has a UILabel and display it to that. However i can’t display it to the label of another class. I did this in 2 ways..1)My First Way, directly calling the label from another class .On my first class, on the methodstatic void on_status_state(NSString *) stats {DisplayViewController* display = [[DisplayViewController alloc] init];display.statusLabel.text = @”Sample Display”; }On the class which contains the UILabel. On DisplayCo
Charles
objective-c ios audio avaudioplayer iphone-sdk-5.0
I’m currently downloading an .mp3 file from a remote server and once the file has loaded, I store it in the Caches directory. Then I create an instance of AVAudioPlayer and load the data into it:- (void)playAudio:(NSString *)path {NSLog(@”start playing audio at path %@”, path);NSError *error = nil;NSData *audioData = [NSData dataWithContentsOfFile:path];_audioPlayer = [[AVAudioPlayer alloc] initWithData:audioData error:&error];if (error == nil){[_audioPlayer play]; } }During the time that
cocotutch
xcode ios4 xcode4 iphone-sdk-5.0
I have a serious ongoing issue with Xcode 4. I have been using Xcode 3 for years, and had everything set up perfectly. All my Build Configurations worked A-OK.I updated to iOS 5 GM, and naturally I have to use Xcode 4 to submit my app to the Store or use TestFlight. I can’t change my Build Configuration. I’ve tried making a new “Scheme” (which are stupid IMHO, when the old system worked 100%), and everytime I do, I set everything the same, I go “Product” > “Archive”….it works, and I share the
Alex
iphone ios core-data entity-relationship iphone-sdk-5.0
Im trying to insert values in a core data entity, but when I try to insert in a Relationship field it crash NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity];NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName: [entity name] inManagedObjectContext:context];[newManagedObject setValue:[NSDate date] forKey:@”fechaAprovacion”];[newManaged
Radix
objective-c xcode uinavigationbar xcode4.2 iphone-sdk-5.0
Hi i am working on iOS SDK5 with xcode 4.2 and i want to prepare a build which should be compatible with iOS 4.0 to 5.0 or at least 4.3 and 5.0I have set the base sdk to 5.0 and deployment target to 4.0 but when i run the app in the iPhone 4 simulator my application crashes basically due to the code written below[testNavigationBar setBackgroundImage:[UIImage imageNamed:@”facebook-navbar.png”] forBarMetrics:UIBarMetricsDefault];but the above code runs fine when i switch the iPhone simulator from
ToBeFrank
objective-c ios ios5 core-data iphone-sdk-5.0
I am running the following code in the IOS 5.1 simulator:Table* sparkFront =[NSEntityDescription insertNewObjectForEntityForName:@”Table”inManagedObjectContext:_context]; NSLog(@”%@”, sparkFront); NSEntityDescription* entity = [NSEntityDescription entityForName:@”Table”inManagedObjectContext:_context]; NSDictionary* dict = [entity propertiesByName]; for (NSObject* key in [dict allKeys]) {NSLog(@”%@”, key); } sparkFront.columnValuesAddress = 0x606;This code crashes with EXC_BAD_ACCESS on the last
Johannes Lund
uinavigationcontroller iphone-sdk-5.0
I have a UINavigationController which I add a subview to.[masterNavigationController.view addSubview:footerViewController.view];The problem is that the app crashes (SIGABRT in main.m) when a UIButton tries to send a message to the controller.I know I could customize the navigationcontroller’s toolbar, but it would make things very complex.Is it possible to add subviews in an navigationcontroller like this, or is something else the problem?– edit —Here is the creation code of the footerviewcon
Peter M
iphone objective-c iphone-sdk-5.0 wait-fences
Another cry for help about this warning.First of all I have looked at every and all questions on here elsewhere and none seem to fit my situation. It has nothing to do with Alert boxes and resigning as first responder, nor performing any animation before views get displayed. My problem occurs when instantiating a UIView based custom keyboard.Secondly, I believe that I can make the warning appear/disappear at will. I am just very confused as to why, so I am looking more for an explanation than
dasblinkenlight
iphone iphone-sdk-5.0
I have an issue running an app on device, (works fine on a simulator)First of all, I do use an ARC on 5.1 and my device is 5.1.1The problem: EXC_BAD_ACCESS occuring at ldr command of the assembly in objc_msgSend.Situation: create MyPage *p, and NSMubleArray *arr add p to arr, and add to the main.view retrive p from arr [p removeFromSuperview] (works fine) [arr removeObjectAtIndex:x] (works fine)at this point, after all above have completed, and there is no outstanding call left, I get the err
B K
xcode4.5 iphone-sdk-5.0 uifont custom-font info-plist
I have been adding custom fonts to my project and know the usual checklist. But recently I tried to add the “Arial Unicode MS” font with filename ARIALUNI.TTF, but when I add the filename to my infoplist under “fonts provided by application” it crashes with a CFDictionaryRemoveValue. I tried changing the .TTF to .ttf, checked the targets and build phases and everything is in order. On running the app, it does not even reach the appdelegate methods and crashes. For any other font that I try to ad
user198725878
iphone ios iphone-sdk-5.0
I am getting the EXC_BAD_ACCESS error on the below code[self provideContent:mySKPaymentTransaction.payment.productIdentifier ]; I am assigning value to the mySKPaymentTransaction as below – (void)recordTransaction:(SKPaymentTransaction *)transaction {mySKPaymentTransaction = transaction; }Please let me know why it is crashing…Thanks
user198725878
iphone ios iphone-sdk-5.0
I have archived my app and given for testing.when i run this app , I dont find any crash on ios5 Version.( i dont have 5.1 device) But my client has 5.1 version, when he tried he got crash when tapping on some button inside the app.So i have asked him the crash report which look as belowDate/Time: 2012-04-23 12:54:10.320 +1000 OS Version: iPhone OS 5.1 (9B179) Report Version: 104Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x00000000, 0x00000000 Crashed Thread: 0Last Except
Costique
ios exception nsarray nsuserdefaults iphone-sdk-5.0
I have the following IBAction set up:#define FAVORITES_KEY @”GraphViewController.Favorites” – (IBAction)addToFavorites:(id)sender {NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];NSMutableArray *favorites = [defaults objectForKey:FAVORITES_KEY];if (!favorites) favorites = [NSMutableArray array];[favorites addObject:self.program];[defaults setObject:favorites forKey:FAVORITES_KEY];[defaults synchronize]; }The first time this action is called it all works well, the object is added
iRebel_85
objective-c uitableview iphone-sdk-5.0 uitableviewdatasource
I have a tableview which is sectioned alphabetically. I have an NSMutableArray *drinks which is my original datasource which its being populated with NSMutableDictionary’s from a plist. in my viewDidLoad method. I then iterate through my array and create the keys for the sections and the number of rows in each section in my viewWillAppear method- (void)viewWillAppear:(BOOL)animated {[super viewWillAppear:animated];self.sections = [[NSMutableDictionary alloc] init];BOOL found;// Loop through the
mahboudz
ios iphone-sdk-5.0
Before 5.0, I useUIBarButtonItem* button = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];But when running on 5.0, it crashed with report:*** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Fixed and flexible space items not allowed as individual navigation bar button item. Please use the leftBarButtonItems (that’s plural) property.’So, how can I replace this property?Thanks.
Jean
iphone ios google linker iphone-sdk-5.0
Some simple things sometimes just don’t work 😉 like this one! Am trying to integrate Google+ SDK into an iPhone App by following the instructions given here:https://developers.google.com/+/mobile/ios/#initialize_the_google_clientI did every single step. But when I build the App, it complains of the following errors:Undefined symbols for architecture armv7:”_OBJC_CLASS_$_GTMOAuth2Keychain”, referenced from:objc-class-ref in libGooglePlusUniversal.a(GooglePlusSignIn.o)”_OBJC_CLASS_$_GTMOAuth2Sign
Nicola Miotto
iphone ios unit-testing uiviewcontroller iphone-sdk-5.0
I’ve got a really weird and unexplainable problem and it’s like the whole day I’m trying to fix it without any result.I have setup a testing target for my iOS project, following the doc steps. I’m using Xcode Version 4.5.2 (4G2008a). I’m also using kiwi. Every test works fine, apart when it comes to load the view of a view controller with xib.The view controller is a simple UIViewController with a MKMapView, a button and a searchbar, all properly hooked to the owner’s IBOutlets.In the test I’m w
madth3
xcode iphone-sdk-4.0 iphone-sdk-3.0 iphone-sdk-5.0
I just changed some code in my program and got this error:Couldn’t register com.yourcompany.XXX with the bootstrap server.Error: unknown error code.This generally means that another instance of this process was alreadyrunning or is hung in the debugger.Program received signal: “SIGABRT”.I tried restoring my program to a version that worked, rebooted, restarted, empty caches and rebuild on versions that even worked before.Any help would be appreciated.
Web site is in building