开发者

Obj c for loop showing out of scope on variable

开发者 https://www.devze.com 2023-02-13 23:39 出处:网络
I am trying to write a for loop in Obj-c and getting \'out of scope\' on my var for ( myObject *i in blah ) {

I am trying to write a for loop in Obj-c and getting 'out of scope' on my var

for ( myObject *i in blah ) {
 i.somevar  开发者_Python百科<--- i showing out of scope in debug mode.
}


myObject should be MyObject; class names are capitalized in Objective-C.

If you are building for Release, the optimizer is on and it could easily be optimizing away i.

0

精彩评论

暂无评论...
验证码 换一张
取 消