Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

joexi/OCGeneric

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

9 Commits

Repository files navigation

OCGeneric

Basis Generic Support in Objective-C.

  • Including OCGenerics.h

  • Register the class you want to use in NSArray

 GENERIC(NSString)
 GENERIC(NSNumber)
  • Declaring a faked NSMuatbleArray like this
 NSMutableArray(NSString) *strAry = [[NSMutableArray(NSString) alloc] init];
 NSMutableArray(NSNumber) *numberAry = [[NSMutableArray(NSNumber) alloc] init];
  • Type Recognize

    The Xcode will figure out the wrong type when you want to add a NSNumber object into an NSString Array

2014年04月16日 4 52 40

  • Extensions

    You can make some extentions based on this by adding more functions into OCGenerics.h

About

Basis Generic Support in Objective-C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /