小编Kev*_*den的帖子

CorePlot - '@'令牌之前的预期令牌

我正在尝试将CorePlot合并到我的项目中.我终于设法识别我的头文件但我在main.m中不断收到以下错误.

"'''令牌之前的预期表达"

int main(int argc, char *argv[])
{ 
    @autoreleasepool { 
    return UIApplicationMain(argc, argv, nil, NSStringFromClass([ProjectFiveAppDelegate     class]));
    }
}
Run Code Online (Sandbox Code Playgroud)

xcode expression core-plot

2
推荐指数
1
解决办法
1874
查看次数

将十进制转换为ASCII字符

我试图将十进制数转换为它的等价字符.例如:

int j = 65 //等效字符为'A'.

对不起,忘了指定语言.我以为我做到了.我正在使用Cocoa/Object-C.真的很令人沮丧.我尝试过以下但仍未正确转换.

char_num1        = [working_text characterAtIndex:i];   // value = 65               
char_num2         = [working_text characterAtIndex:i+1];    // value =  75
char_num3         = char_num1  + char_num2;         // value = 140                                      
char_str1   = [NSString stringWithFormat:@"%c",char_num3];  // mapped value = 229
char_str2   = [char_str2 stringByAppendingString:char_str1];    
Run Code Online (Sandbox Code Playgroud)

当添加char_num1和char_num2时,我得到新的ascii十进制值.但是,当我尝试将新的十进制值转换为字符时,我没有得到映射到char_num3的字符.

ascii character decimal

1
推荐指数
1
解决办法
3万
查看次数

变量失去价值(iPhone SDK)

我在头文件中声明了一个变量,并在实现中合成它.当视图加载(ViewDidLoad)时,我读取了一个plist文件,用一个值填充变量.在我的NSLog中,我看到该变量包含该值.但是,在视图加载后,我通过按钮执行一个方法与用户进行一些交互.用那个方法我再次检查值,它是无效的.为什么变量在初始加载后不会保持其值?

program.h

....
NSString * user_title;
...
@property (nonatomic, retain) NSString *user_title;
Run Code Online (Sandbox Code Playgroud)

program.m

@synthesize user_title;

-(void)viewDidLoad{

    NSString *filePath = [self dataFilePath];
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
{
    NSArray *array = [[NSArray alloc] initWithContentsOfFile:filePath];
    user_title = [array objectAtIndex:0];
    [array release];
}
    ....


-(IBAction)user_touch_screen:(id)sender
 {
    user_label.text = user_title;  //user_title has an invaliud value at this point
   ....
Run Code Online (Sandbox Code Playgroud)

iphone sdk cocoa touch

0
推荐指数
1
解决办法
365
查看次数

控制应用程序执行次数

有没有办法控制iPhone应用程序执行的次数.例如,我有一个名为widget的游戏,我只希望用户玩游戏(新实例)不超过20个.另外,如果可以,那么你怎么能阻止这个人删除然后下载app再次获得另外10场比赛?

iphone sdk cocoa-touch

0
推荐指数
1
解决办法
84
查看次数

标签 统计

iphone ×2

sdk ×2

ascii ×1

character ×1

cocoa ×1

cocoa-touch ×1

core-plot ×1

decimal ×1

expression ×1

touch ×1

xcode ×1