我這裏檢查的問題上堆棧溢出和我做同樣的方式,但仍然返回NULL傳遞變量空
的第一視圖
在firstviewcontroller.hi有
@property (nonatomic, copy) NSString *Astring;
在secondviewcontrolle的firstviewcontroller.m
#import "SecondViewController.h"
...
@synthesize Astring = _Astring;
...
- (IBAction)filterSearch:(id)sender {
NSlog(@"%@",Astring)
}
RM
#import firstviewcontroller.h
...
...
FirstViewController *controller = [[FirstViewController alloc]initWithNibName:@"FirstViewController" bundle:nil];
controller.Astring = @"YES";
所以basicly我做一個變量在firstviewcontroller並在secondviewcontroller變量傳遞給第二個觀點,但它返回NULL總是...
是我的邏輯錯誤,或別的東西
你的#import有問題,你好像倒了它們。它不會糾正這個問題,但問題會更容易理解。 – rdurand
在NSLog嘗試self.Astring而不是隻是Astring – Yarlik
@Yarlik 2bad它仍然是NULL – MichaelAngelo