Friday, October 18, 2013

CoreData changes

There were some CoreData changes in iOS 7.

I had to add @{ NSSQLitePragmaOptions : @{ @"journal_mode" : @"DELETE" } } to my code to make it work right importing the database from before. The new way adds -shm and -wal files in SQLite DB.

I found this cool CoreData Editor app from Germany but Apple's douchy market limits won't let me buy it.

More interesting stuff

Interesting bit about protocol declarations needing to be made before includes.

Unsolved: when I change the Main View in XCode it bugs out. Lots of other people had this problem too:

- this class is not key value coding-compliant for the key authView

Wednesday, October 16, 2013

Useful lil things lately in IOS

I figured some cool stuff out on Key-Value coding for scalar values that are properties of objects:

Also found Touches ended usefule


Good shit on bitwise operators:

PCI-compliance is important for storing credit cards

NSSortDescriptors are kind of annoying but maybe cool and useful

Unlike LSL, finding something in an array if it's not there doesn't return -1 but instead 214783647

The NSRange is an interesting structure

I encountered weirdness trying to use TableViewCell's highlighted feature, ended up just giving up and painting my own way of doing it. Probably cuz I was doing it wrong but anyway who cares.

I do want to add a search bar in tableview in an upcoming version

I was trying to think of how to make my UIMenuController not be black-on-black... never got to that

Saw Mission Street Grants and thought of applying:

I asked this question on CoreData but got no answers;

Was curious about iOS7/iOS6 deltas in InterfaceBuilder, found this:

Here's how to update your app to a new version, which isn't working for me right now:

Here's how to beta test your app which also isn't working for me right now:

This was an awesome way to customize the colors of a UISegmentedControl

Saw this interesting idea of "passing around an NSManagedObjectContext" in iOS for keeping ViewControllers segmented. I should read this. It explains why not to be accessing the instance of one viewController inside another viewController, which I seem to do alot.

I also need to read up on Throwing Exceptions.

This was an awesome help tomake a segment of a UISegmentedControl deselect itself.

setBackgroundImage:forState:barMetrics: was useful for coloring my UISegmentedControl.

I thought about trying to animate the angle view display but after seeing that there was a CoreAnimation manifesto I kind of gave up, it doesn't seem to want to animate lines, just layers...

Luda gave an excellent explanation of how to add the done button, OK button, cancel button, or whatever on top of your keyboard in your iOS app.

XS-Labs gives an excellent rundown on XCode build settings

I asked this really stupid question on StackOverflow as to why integers don't get auto-cast as floats when getting assigned to floats. -11 lol

Save graphics from app to camera roll

Add custom fonts to iOS app

Audio capture project

Found this cool project and downloaded it for audio capture and shit

NSNotification to work for the accessibility feature where you invert the screen

I couldn't get the NSNotification to work for the accessibility feature where you invert the screen

I asked this question on stackOverflow:

I am not sure if this is an iOS 7 bug or what. But..I cannot get the UIAccessibilityInvertColorsStatusDidChangeNotification to work.

So when I init my nib I do this:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {

if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {

[[NSNotificationCenter defaultCenter] addObserver:self





return self;


Later in my code I have the notification:

- (void)inverted {

if(UIAccessibilityIsInvertColorsEnabled()) {

NSLog(@"setting tintcolor to cyan");

self.view.tintColor = [UIColor cyanColor];

[self tintColorDidChange];

} else {

NSLog(@"setting tintcolor to red");

self.view.tintColor = [UIColor redColor];

[self tintColorDidChange];



However when my app is running and I change the Invert Colors mode via tripple-tap on the home button, nothing happens in the app. Don't get a message on console, don't get a change of tintColor, don't get nothin'.

I tested this on iOS 6 and iOS 7. I tried setting my build target for iOS 6.1 instead of 4.3 and that didn't fix it either.

I tried adding -(void)inverted; to my interface and that didn't fix it. I tried adding the colon after inverted but that didn't fix it either, and the docs say that this notification doesn't have an argument anyway.

Obviously I'm doing something wrong. What? Thanks in advance.