IOS Dev - how to modify framework

Associate
Joined
26 Nov 2006
Posts
1,091
noobie question - I want to add a couple of variables to MKAnnotation.H which is a framework file and it is protected, how do I modify it?
 
As far as i know its a protocol, AKA a interface in languages like java or c#.

You create class, and implement the protocol and add whatever you want to it.

How much Object orientated programming do you know?

You never directly modify framework source code...
 
As said above, you can't directly modify the framework, you have to extend off it with a new class or include the framework to use in your new class and overwrite specific functions in your new class.

For example, - init is always called for a new object, but you can overwrite the init function in your code to extend it to do what you want and then return to it's super (the original init). Think along those lines when trying to modify parts in the framework.

I hope that helps (although my explanation looks like it sucks :p)
 
Look into categories or subclassing. As AL05 said, MKAnnotation it is a protocol so if you are including new protocol/delegate methods in your subclass, you'll need to make sure all classes where it is used conform to your (sub)protocol.
 
Look into categories or subclassing. As AL05 said, MKAnnotation it is a protocol so if you are including new protocol/delegate methods in your subclass, you'll need to make sure all classes where it is used conform to your (sub)protocol.

This :D

If you're wanting to run the app on any standard phone, or any phone that can be upgraded (jailbroken or not) then don't attempt to change a system framework.
 
Back
Top Bottom