On Sat, Oct 25, 2014, at 10:15 AM, Jaikanth CK wrote:
> Hi All,
>
> I need to extend a class for NSCoding protocol conformance.
You can't do this yet. Required initializers must be implemented in the
main class body, and NSCoding has a required init(coder:) initializer.
Hi All,
I need to extend a class for NSCoding protocol conformance.
I tried the following code in the playground and get an error - required
initialiser cannot be declared in the extension. If I do not make it
required, I get an error asking to make it required ...and so on
class first
From the documentation:
...
A default’s value must be a property list, that is, an instance of (or
for collections a combination of instances of): NSData,NSString,
NSNumber, NSDate, NSArray, or NSDictionary. If you want to store any
other type of object, you should typically archive it to c
Hi,
Question about registering defaults - I'd assumed the following would
be valid, assuming that GuideSettings implements the NSCoding protocol
- but my app doesn't like this and throws a bad access exception in
CFRetain when I run this code:
The bit that falls o
On Fri, Oct 10, 2008 at 12:52 PM, Negm-Awad Amin <[EMAIL PROTECTED]> wrote:
> Yup, you are complelty right. The correct code:
>
> if( [BaseClass [EMAIL PROTECTED]( initIWithCoder: )] ) {
> …
If you want to get really fun, you can check it thus:
if([super.class instancesRespondToSelector:...])
Th
Am Fr,10.10.2008 um 18:17 schrieb Clark Cox:
On Fri, Oct 10, 2008 at 9:09 AM, Negm-Awad Amin <[EMAIL PROTECTED]
> wrote:
Am Fr,03.10.2008 um 21:00 schrieb [EMAIL PROTECTED]:
I want MyClass to conform to the NSCoding protocol. But I'm
puzzled about
how to implement the in
On Fri, Oct 10, 2008 at 9:09 AM, Negm-Awad Amin <[EMAIL PROTECTED]> wrote:
>
> Am Fr,03.10.2008 um 21:00 schrieb [EMAIL PROTECTED]:
>
>> I want MyClass to conform to the NSCoding protocol. But I'm puzzled about
>> how to implement the initWithCoder: method.
>&g
Am Fr,03.10.2008 um 21:00 schrieb [EMAIL PROTECTED]:
I want MyClass to conform to the NSCoding protocol. But I'm puzzled
about how to implement the initWithCoder: method.
Suppose I have this in MyClass.h:
NSString *S1, *S2, *S3;
and this in its init function:
S1
On 4 Oct 2008, at 9:29 am, [EMAIL PROTECTED] wrote:
But now I'm confused about how to de-allocate MyClass. Given this in
its initialisation:
S1 = @"a string";
S2 = [[NSString alloc] init];
S3 = [NSString string];
I would only release S2 in the dealloc method. But if
On Fri, Oct 3, 2008 at 4:29 PM, <[EMAIL PROTECTED]> wrote:
> But now I'm confused about how to de-allocate MyClass. Given this in its
> initialisation:
>
>S1 = @"a string";
>S2 = [[NSString alloc] init];
>S3 = [NSString string];
The line for S3 is wrong since you presumab
Thanks for your replies.
But now I'm confused about how to de-allocate MyClass. Given this in
its initialisation:
S1 = @"a string";
S2 = [[NSString alloc] init];
S3 = [NSString string];
I would only release S2 in the dealloc method. But if the class has
been unarchi
On Oct 3, 2008, at 1:00 PM, [EMAIL PROTECTED] wrote:
So finally, my question: am I right to retain S2 and S3, and not S1?
No. -decodeObject: and -decodeObjectForKey: always return autoreleased
objects, so if you use them later, then you must retain them unless
the code requires GC.
Nic
Assuming this is not under GC...
On Fri, Oct 3, 2008 at 2:00 PM, <[EMAIL PROTECTED]> wrote:
> I want MyClass to conform to the NSCoding protocol. But I'm puzzled about
> how to implement the initWithCoder: method.
>
> Suppose I have this in MyClass.h:
>
>NSSt
I want MyClass to conform to the NSCoding protocol. But I'm puzzled
about how to implement the initWithCoder: method.
Suppose I have this in MyClass.h:
NSString *S1, *S2, *S3;
and this in its init function:
S1 = @"a string";
S2 = [[NSString alloc] in
14 matches
Mail list logo