Why can't I push a new view controller onto the current view?

I'm going to say that you've not imported ChangePasscode. H in your current file.

I'm going to say that you've not imported ChangePasscode. H in your current file. Update: In response to comment thread below, you'll need to actually create a nav structure if you want to push view controllers.

The preferred way in iOS 5 is as follows: // AppDelegate. H // …Other existing code @property (nonatomic, retain) UINavigationController *navController; @end // AppDelegate. M @synthesize navController; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { navController = UINavigationController alloc initWithRootViewController:viewController; self.

Window = UIWindow alloc initWithFrame:UIScreen mainScreen bounds; self.window. RootViewController = navController; self.window. BackgroundColor = UIColor whiteColor; self.

Window makeKeyAndVisible; return YES; }.

Correct! But... I get this error when compiling: f.cl. Ly/items/0x2t1A2c12383d2M130h/2ndXCodeIssue.

Tiff – pixelbitlabs Nov 2 at 19:35 Try a Clean (Product > Clean). You can also clean the build folder by holding down the Option key when you click the Clean menu choice. – Inspire48 Nov 2 at 19:55 it works now, because I changed "#import "ChangePasscode.

M"" to "#import "ChangePasscode. H"" - although when the action to push the new view controller is called, nothing happens? The code is exactly the same.

Nothing in the NSLog either :( – pixelbitlabs Nov 2 at 19:58 There's not much to go on…assuming you actually have a navigation controller system implemented, try an NSLog to see if cpscreen is nil or not. Also, which NSLog are you referring to? – Inspire48 Nov 2 at 20:02 Is there anything else I can push the new view controller from other than "navigationController"?

I tried "window" but it didn't work because I am not working in an App Delegate... – pixelbitlabs Nov 2 at 20:04.

Change NSBundle mainBundle to nil make sure you have import ChangePasscode. H on top of the M file.

Fixed that error because I hadn't used the "#import" code. However, I now get this error when compiling: f.cl. Ly/items/0x2t1A2c12383d2M130h/2ndXCodeIssue.

Tiff – pixelbitlabs Nov 2 at 19:36.

Use @class ChangePasscode; rather than using #import ChangePasscode.h.

That's what I was doing but had the errors explained in the question so I changed to #import and my new error is: f.cl. Ly/items/0x2t1A2c12383d2M130h/2ndXCodeIssue. Tiff – pixelbitlabs Nov 2 at 19:37 It seems that you are compiling the same ChangePasscode class two times in different places of your code.

This may happen in the following cases. You have put the same class implementation into two different files; You actually have just one implementation of this class, however you are also linking in your project a framework or library containing a class whose name is exactly the same of yours. Try finding in the whole project your class and make sure only one copy is available within your project.

– aahsanali Nov 2 at 19:43 how can I do this? What do you mean? :S – pixelbitlabs Nov 2 at 19:45 check your project directory for ChangePasscode class and make sure that there is SINGLE ChangePasscode.

H and ChangePasscode. M file. There may be possibility that you have added same named class reference to your project from some other location.

– aahsanali Nov 2 at 19:50 there aren't any class references in the whole project at all and I have done as you have said but the issue still remains :( – pixelbitlabs Nov 2 at 19:51.

I am thinking this is a classic case of circular references. Maybe the two classes reference each other? Because of this forward declaration you might get all kinds of warnings when trying to reference the class name or properties of the class that has the forward declaration.

Where all have you included ChangePasscode. Also use #import rather than #include. UPDATE: To solve your ld: duplicate symbol... error It seems that you are compiling the same class ChangePasscode two times in different places of your code.

This may happen in the following cases. You have put the same class implementation into two different files You actually have just one implementation of this class, however you are also linking in your project a framework or library containing a class whose name is exactly the same of yours. You could also get this error if you mistakenly let XCode's auto-complete for #import statements specify the '.

M" file for the 'duplicate' class instead of the '. H'. Try finding in the whole project your class and make sure only one copy is available within your project.

Fixed that error because I hadn't used the "#import" code. However, I now get this error when compiling: f.cl. Ly/items/0x2t1A2c12383d2M130h/2ndXCodeIssue.

Tiff – pixelbitlabs Nov 2 at 19:36 Clearly you have redefined some class variables across . M files. Correct that by renaming the conflicting names & you are good to go.

– Srikar Nov 2 at 19:46 I've checked and there are absolutely no class references at all :/ – pixelbitlabs Nov 2 at 19:48 there has to be your error states the there was a duplicate symbol in your ChangePasscode. So please look again. – Srikar Nov 2 at 19:50 when it says "duplicate symbol" what exactly does that mean?

What else am I supposed to be looking for? I have searched all over several times and there are absolutely no class references! :( – pixelbitlabs Nov 2 at 19:53.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions