Tag: objective c

animationDidStop set but not being called (iPhone app coding)

#import “MyViewController.h” @implementation MyViewController @synthesize menuView, gameView, helpView, optionsView, gameButton, helpButton, optionsButton; – (void) viewDidLoad { [self setView:menuView]; } – (IBAction)gotoGame { [UIView beginAnimations:@”buttonSlide” context: nil]; [UIView setAnimationDuration:1.5]; [UIView setAnimationDidStopSelector:@selector(animationDidStop)]; gameButton.center = CGPointMake(104,1000); [UIView commitAnimations]; } – (IBAction)gotoHelp { [self setView:helpView]; } – (IBAction)gotoOptions { [self setView:optionsView]; } – (void)animationDidStop { NSLog(@”why is this not […]

Undefined symbols and duplicate symbols errors. Can build for debug, or release, but not both

I have an issue with a project that includes another project. The second project is an SDK which is required for the main project. At the moment, I have the SDK included in the main project as a static library. Both the SDK and the main project include the FBConnect and Unofficial Twitter SDK frameworks. […]

Keyboard doesn't disappear

While using UITextField in objective c, keyboard appears, after typing some figure I wanna move to another Textfield or button but neither the cursor removes from text field nor the key board disappears. Wat should i do? tempTextField.borderStyle = UITextBorderStyleBezel; tempTextField.textColor = [UIColor blackColor]; tempTextField.font = [UIFont systemFontOfSize:17.0]; tempTextField.placeholder = @””; tempTextField.backgroundColor = [UIColor blueColor]; […]

make NSUndoManager ignore a property of an NSManagedObject

My app’s main function is to arrange objects on a plot. The whole thing is based on Core Data, and each object on the plot is represented by an entity. For this example, that entity will be “Unit,” a custom subclass of NSManagedObject. When the plot is opened, each Unit gets a UnitViewController created, which […]

Singleton NSMutableArray accessed by NSArrayController in multiple NIB's

Early warning – code sample a little long… I have a singleton NSMutableArray that can be accessed from anywhere within my application. I want to be able to reference the NSMutableArray from multiple NIB files but bind to UI elements via NSArrayController objects. Initial creation is not a problem. I can reference the singleton NSMutableArray […]

custom setter for NSString

I have a NSString called fontType and I am trying to have a custom setter for it: – (void) setFontType:(NSString *) fType { if (self.fontType != fType){ [fontType release]; self.fontType = [fType retain]; //some more custom code } } Is there any issue with this?

drawInRect:withAttributes dies with “message sent to deallocated instance”

I am updating an app for iOS 7. One of the changes is switching to the new drawInRect:withAttributes function instead of the deprecated drawInRect:withFont… This was working fine on the iOS 7 beta, but today after upgrading to the latest iOS 7 version, the app crashes on the line: [text drawInRect:theRect withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:fontSz], NSFontAttributeName, […]

ViewController with TalbeView and CollectionView tabs like Google+ in IOS

i’m trying to understand how to build something like this (google plus profile page): Seems that there is a header (like tableheaderview) and, when the user tap on Foto, Post or Info the bottom change to UiTableView, UiCollectionView. How can i realize this? With ContainerView?

Application crash when set header of UICollectionView horizontally

I am pretty new in UICollectionView. And I am really tired to find out the solution. I am trying to add Header in 3 Horizontally Row. I am using Collection view flow layout. Here is my code which I implement: – (void)awakeFromNib { self.collectionView.backgroundColor = [UIColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:1.0]; self.collectionView.backgroundColor = [UIColor clearColor]; self.collectionView.backgroundView […]

Status bar rotates separated from UIWindow

I have to create application with two UIWindow (please, don’t ask why). First UIWindow‘s rootViewController supports all orientations. Second one – only portrait and upside down. So application delegate code looks like: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // part one self.windowOne = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; self.windowOne.rootViewController = [[ViewControllerOne alloc] init]; // […]