Featured post
iphone - Objective-c Novice - Needs help with UIViews -
im new iphone development , after lots of reading on im still trying figure out how uiviews operate properly. have been playing , @ far:
i have created new xcode project using view-based application. have mmappviewcontroller classes , created new uiviewcontroller subclass called "level1view".
there button titled "level 1" takes me "level1view" viewcontroller. in viewcontroller there there "next" button, "main menu" button (that returns mmappviewcontroller) , there label, titled "level 1".
my problem code have used change title of label not work! know why is? here code:
@class mmappviewcontroller; @interface mmappappdelegate : nsobject <uiapplicationdelegate> { uiwindow *window; mmappviewcontroller *viewcontroller; } @property (nonatomic, retain) iboutlet uiwindow *window; @property (nonatomic, retain) iboutlet mmappviewcontroller *viewcontroller; @end
and
@implementation mmappviewcontroller -(ibaction)pushlevel1{ level1view *level1view = [[level1view alloc] initwithnibname:nil bundle:nil]; [self presentmodalviewcontroller:level1view animated:yes]; } ...
and
#import <uikit/uikit.h> @interface level1view : uiviewcontroller { iboutlet uilabel *labeltitle; } -(ibaction)pushback; -(ibaction)pushnext; @end
and
#import "level1view.h" #import "mmappviewcontroller.h" @implementation level1view -(ibaction)pushback{ mmappviewcontroller *mainview = [[mmappviewcontroller alloc] initwithnibname:nil bundle:nil]; [self presentmodalviewcontroller:mainview animated:yes]; } -(ibaction)pushnext{ [labeltitle settext:(@"thanks playing :)")]; } - (void)didreceivememorywarning { ...
currently app runs label wont change when hit "next" button. can help?
did bind label in interface builder labeltitle outlet in level1view?
if forget step, outlets won't work. after several years, still forget step sometimes.
--mike
- Get link
- X
- Other Apps
Comments
Post a Comment