简体   繁体   English

将服务器中的值分配给目标-c中的整数

[英]assign value from server to integer in objective -c

I am coming from swift background, I have a code in objective -c that take value from server and it takes correctly here is the code bellow. 我来自敏捷的背景,我有一个目标-c中的代码,该代码从服务器获取价值,而正确的代码在下面。

if (![message_expiration intValue]){
    NSLog(@"Check the message expiration integer value");


    _MessageExpire = [message_expiration intValue];




}

and I have a variable: 我有一个变量:

@property (nonatomic, assign) NSInteger *MessageExpire;

what I want is: My variable that is integer takes the value that come from server and I did in this way : 我想要的是:我的整数变量采用了来自服务器的值,而我这样做是这样的:

_MessageExpire = [message_expiration intValue];

but I get the error that say: incompatible integer to pointer conversion assigning ..... 但我得到的错误是:指针转换分配不兼容的整数..

Any help appreciate 任何帮助赞赏

Objective - C 目标-C

Did not assign pointer(*) to NSInteger 没有将指针(*)分配给NSInteger

@property (nonatomic, assign) NSInteger MessageExpire;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM