objective-c-runtime

who released my object on the handler file?

Hi guys, I'm a newbie on the iphone development world.. I started a new project, I used it to test what I learned about objective c, it basically sends and recives data from my local server, then, I store some of that data inside the class, it works fine. Everything is on the command line. my class definition: @interface MyClient : N...

iOS app, classes suddenly vanish, crash in alloc

This is a weird one. On and off as I have been working on my application, this problem has popped up, and then it has always mysteriously vanished. Today it is refusing to vanish. My app uses two view controllers to handle auto rotation. Sometimes, Objective-C can't find my classes. For example [OneViewController alloc] will crash. ...

class_getClassMethod often returns nil (seems to work only with class level Methods)

Hi all, Im currently trying to use some generated code from http://sudzc.com/ This code is not perfectly adapted to my web services, so I tried to add Categories to some of the generated classes and to exchange their implementations with the original ones using method_exchangeImplementations from "objc/runtime.h". (I could modify the ge...

What is the difference between *(id *)((char *)object + ivar_getOffset(ivar)) and object_getIvar(object, ivar)

According the Objective-C runtime reference: ivar_getOffset Returns the offset of an instance variable. ptrdiff_t ivar_getOffset(Ivar ivar) Discussion For instance variables of type id or other object types, call object_getIvar and object_setIvar instead of using this offset to access the instance variable data dir...

What's required to implement root class of Objective-C?

I tried this code: // main.m #import <stdio.h> @interface Test + (void)test; @end @implementation Test + (void)test { printf("test"); } @end int main() { [Test test]; return 0; } with LLVM/Clang without any framework, it doesn't compiled with this error: Undefined symbols: "_objc_msgSend", referenced from: _ma...

objective-c memory management

Hi guys, i have some questions about objective-c's memory management, let's say: NSString * test= [[NSString alloc] init ] test=@"msg"; [object setStr1: test ]; // declared as: @property(copy, readwrite) [object setStr2: test ]; // declared as: @property(retain, readwrite) [object setStr3: test ]; // declared as: @property(assign,...

How to build a Ruby extension with Objective-C using new exceptions (@throw…)?

I have build a Ruby extension in Objective-C. Now I want to use @throw/@catch etc. instead of macro based exception handling and self build error handling. I am using the GNU runtime shipped with the GCC. When I run my Ruby app with my extension it core dumps as soon as an exception occurs. The abort() comes from the GNU Objective-C r...

Objective C small syntax clarification

Hi, I have seen this code in most of the time. Here there are two variable names defined and in the implementation it synthesizing by assigning. Whats the purpose of doing some thing like this? Like keeping 2 separate variable names. Is this sort of a convention? Test.h @interface Test { id<something> _variable1; } @property (nona...