Objective-C Stack implementation
-(id)pop{
    id lastObj = [stack lastObject];
    [stack removeLastObject];
    return lastObj;
}


Not sure if you are using ARC, but without ARC this is a potential use-after-free bug.  If you are not using ARC you should consider:

-(id)pop{
    id lastObj = [stack lastObject];

    if (lastObj)                         // &lt; -- now checking for nil
    {
       [[lastObj retain] autorelease];   // &lt; -- this line added

       [stack removeLastObject];
    }
    return lastObj;
}


(This also assumes that the objects in the stack are NSObjects, but I believe NSMutableArray makes the same assumption...)

This bumps the ref count up so that the next line (which will cause the NSMutableArray to release its reference to the object) does not end up deallocating the object.

Update on second reading:

Also, what do you do when lastObj is nil (i.e. too many pops)?  Doesn't seem like you've handled that case.