Tag: xcode

Where does iPhone simulator put data files?

If I compile my iPhone App with a database that has been built into the bundle what path do I have to use to find the file so that I can open it, as in: FMDatabase* db = [FMDatabase databaseWithPath:@”/???/database.sqlite”];

Google OAuth 2.0 invalid_client Unauthorized

I used this code to authorize Google+ via OAuth 2.0 oauthswift = OAuth2Swift( consumerKey: “984813079630-f828a92sqtl5lgumd4kgp9i30bs9og09.apps.googleusercontent.com”, consumerSecret: “AIzaSyD13MBv78yWIjl4TX9jOOT9AWuEkYdVSPQ”, authorizeUrl: “https://accounts.google.com/o/oauth2/v2/auth”, accessTokenUrl: “https://www.googleapis.com/oauth2/v4/token”, responseType: “code” ) let handle = oauthswift.authorize( withCallbackURL: URL(string: “com.googleusercontent.apps.984813079630-f828a92sqtl5lgumd4kgp9i30bs9og09:/oauth”)!, scope: “profile”, state:”GOOGLE”, success: { credential, response, parameters in print(credential.oauthToken) // Do your request }, failure: { error in print(error.localizedDescription) print((error as OAuthSwiftError).errorUserInfo) } […]

How do I initialize CMMotionManager globaly to be used by different classes?

i am trying to initialize the device motion manager in a class that contains all of my global variables to use in different classes. However i cant seem to get this working. I have this in my global class: // Motion Manager CMMotionManager *motionManager; Then set the property in a different class header file: @property […]

Mac OSX – Xcode Installation Directory

After Xcode has finished building is there a way to make it copy the executable to specific directory ~/Sites/cgi-bin/ I have the target Installation Directory set to the correct folder, with skip installation unchecked, but no luck. Is there something i’m missing?

Too many arguments to method call, expected 1, have 2?(Xcode)

There are many other similar questions to this one, but there is a lack of answers and they vary for each project. I have this error ‘Too many arguments to method call, expected 1, have 2?’ But on the previous arrays that I used this error did not occur? it could be a problem with […]

Decreasing FPS while adding obstacles

I am new to cocos2d-x and I am developing a game in x-code using cocos2d-x.In my game i have a menu scene and game scene. In my game scene after adding the obstacles FPS is decreasing to 10 So my game performance is very low. Following is the code which i used to add obstacles […]

How to search(Predicate) content from list like Xcode suggestion?

I think everyone notice XCode suggestions list. Check this screenshot As per Apple document doesn’t provide what expected ouptut. NSPredicate *inPredicate = [NSPredicate predicateWithFormat: @”attribute CONTAINS[cd] %@”, aCollection]; Provide continuous search text only. Is this possible, How to search content like this?

Large database – Best way to display data on device?

I am currently creating an iOS app, which connects to a database and asynchronously downloads a JSON object of data to display in a table view. As it currently stands, this is an ok way to do it. However, when the database starts getting much larger, this will cause a massive inconvenience. I’m reasonably proficient […]

UITextfields returning null in iOS 6

I just updated my dev system for iOS 6 and when I was testing a app I built I am now just getting (null) from my UITextfields. Here is a example of what I am doing: NSString *email = usernameField.text; After typing in that textfield and returning what I typed I only get (null) What […]

Error when updating core data in the background

I use this function to delete and then add core data in the background: – (void) resetDatabase { count++; dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){ ConDAO *con = [[ConDAO alloc] init]; DatabaseManager *manager = [DatabaseManager sharedManager]; NSError * error; NSURL * storeURL = [[[manager managedObjectContext] persistentStoreCoordinator] URLForPersistentStore:[[[[manager managedObjectContext] persistentStoreCoordinator] persistentStores] lastObject]]; [[manager managedObjectContext] reset];//to drop pending changes […]