Home » Code, Hacker's Approach

iPhone Development Tip : How to Dynamically Initialize Class in Objective-C

4 November 2009 One Comment

While working on an iPhone project i wanted a way to dynamically initialize classes, and then i found one simple way. Sharing it here since it may help someone someday.

[[NSClassFromString(@"Class name") alloc] init];

That’s all for now.

Related posts:

  1. iPhone Development Tip : Custom UINavigationBar More and more developers are creating custom user elements these...
  2. iPhone Development Tip : Debugging Memory release I was struggling with a bug in my latest iPhone...
  3. iPhone Dev Tip: How to find out Available/Free Memory The iPhone has limited memory,and as developer its our responsibility...

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

One Comment »

  • Ted said:

    Gr8 tip man. Helped me a lot.