answerstu

iphone - OpenGL perspective and lighting problem

I have a sample 3d scene rendered using OpenGL ES 1.1.Here is what I get when I have identity projection matrix (I'm also using normal and specular maps):So everything looks OK.But if I set perspective using glFrustum I get this:So it seems that normals are being inverted and if I try to multiply them by -1 I get this:It has an effect like the light was from the opposite side.I should also mention that when using identity projection matrix I have to set glCullFace(GL_FRONT); (I think this is because normalized device coords are left handed).I'...Read more

iphone - Cocos2d Input layer only recieves touches on top of a sprite

I'm building a game with Cocos2d for iPhone, and right now I'm trying to get Touch input working. I've enabled touch response on an independent control layer in a multi-layer scene, and it's working fine - except it ONLY fires the touch methods if the touch was on top the sprite that I have on a separate layer(the separate layer is actually just a node). I don't have any other on-screen content aside from that sprite.here's my control Layer implementation:#import "ControlLayer2.h"extern int CONTROL_LAYER_TAG;@implementation ControlLayer2+(void)...Read more

iphone - Adding two CCLayers in a single CCScene side by side

I am trying to add two CCLayers side by side (not one over another) on a single scene, with second layer having a table view on it. I have added the table view as the subview to the [[CCDirector sharedDirector] view]. The size of the second layer is that of the screen size & the size of the first layer is some what less than the size of the screen. When this screen appears, first second layer is shown. After clicking a particular button on the second layer, the scene animates to the right along with the table on second layer, showing the fu...Read more

iphone - What do I have to do to get Core Data to automatically migrate models?

I have read in the documentation about automatic /lightweight migration for Core Data models - but am having problems in the reality of implementing it.As I understand it the application should notice that the model it has and the model that exists on a device already are not the same. If you have only added attributes or relationships and similar simple changes then the model should be upgraded automatically.Any pointers - do I need to set something in xCode?...Read more

Implementation of "Automatic Lightweight Migration" for Core Data (iPhone)

I would like to make my app able to do an automatic lightweight migration when I add new attributes to my core data model.In the guide from Apple this is the only info on the subject I could find: Automatic Lightweight Migration To request automatic lightweight migration, you set appropriate flags in the options dictionary you pass in addPersistentStoreWithType:configuration:URL:options:error:. You need to set values corresponding to both the NSMigratePersistentStoresAutomaticallyOption and the NSInferMappingModelAutomaticallyOption...Read more

iphone - Core Data Lightweight Migration Attribute Renaming

I know there is a lot of questions about Core Data Migration here in Stack Overflow but I couldn't find a solution for my problem. I successfully did a Lightweight migration by renaming an attribute called "LastName" in the source model to "Lastname" in the destination model. I did step by step to achieve this and it works except the fact that all of the previous data on the column "Lastname" now is lost. The new renamed attribute exists, i can insert new Entities and the values of the new inserted entities are ok. The problem holds on the old ...Read more

iphone - Understanding reference counting with Cocoa and Objective-C

I'm just beginning to have a look at Objective-C and Cocoa with a view to playing with the iPhone SDK. I'm reasonably comfortable with C's malloc and free concept, but Cocoa's references counting scheme has me rather confused. I'm told it's very elegant once you understand it, but I'm just not over the hump yet.How do release, retain and autorelease work and what are the conventions about their use?(Or failing that, what did you read which helped you get it?)...Read more

ios - armv7s error while Archive in iPhone

Possible Duplicate: linker command failed with exit code 1 xcode4.5 I am getting following error while i am archive my app for app store ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/***************/l******/*****ppCircle.a for architecture armv7sclang: error: linker command failed with exit code 1 (use -v to see invocation)i tried to remove armv7s from my target then some new error start occuring.how i can resolve it...Read more

iphone - I'm having linking warning

I'm doing a tab button on my navigation bar of my (FirstViewController),when i press button it should pop me the view controller(FlipsideViewController).i had this linker error message Undefined symbols for architecture i386: _OBJC_CLASS_$_FlipsideViewController", referenced from: objc-class-ref in FirstViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)this is my code in#pragma mark - Flipside View - (void)flipsideViewControllerDidFinish:(Fl...Read more