1
    static GCHelper *sharedHelper =nil;
    + (GCHelper *) sharedInstance
    {
         @synchronized ([GCHelper class])
    {
            If (!shareHelper)
    {
            [[self alloc] init];
    }
       return nil;
    }

I have it to run gamecenter but it gives me an error of "expression result unused" how do i fix this

Juan
  • 11
  • 1

1 Answers1

3

You're not actually assigning the result of [[self alloc] init] to shareHelper, which you almost certainly mean to do. This warning is pointing out your mistake.

Rob Napier
  • 286,113
  • 34
  • 456
  • 610
  • It is not lettimg me archive it because of that error how will i fix this – Juan Nov 18 '11 at 21:40
  • Do i just need to delete the line with [[self alloc]init] – Juan Nov 18 '11 at 21:41
  • Assign it. `shareHelper = [[self alloc] init];` But the above code doesn't even work. It always returns `nil`. See http://stackoverflow.com/questions/145154/what-does-your-objective-c-singleton-look-like for proper ways to implement this method. – Rob Napier Nov 18 '11 at 21:44