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:

https://developer.apple.com/library/ios/documentation/cocoa/conceptual/KeyValueCoding/Articles/DataTypes.html

Also found Touches ended usefule

https://developer.apple.com/library/ios/documentation/uikit/reference/UIResponder_Class/Reference/Reference.html#//apple_ref/occ/instm/UIResponder/touchesEnded:withEvent:

touchesEnded:withEvent:

Good shit on bitwise operators:

http://www.codeproject.com/Articles/2247/An-introduction-to-bitwise-operators

PCI-compliance is important for storing credit cards

http://www.pcicomplianceguide.org/pcifaqs.php

NSSortDescriptors are kind of annoying but maybe cool and useful

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSSortDescriptor_Class/Reference/Reference.html#//apple_ref/occ/clm/NSSortDescriptor/sortDescriptorWithKey:ascending:

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

http://stackoverflow.com/questions/10929929/indexofobject-return-2147483647

The NSRange is an interesting structure

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html#//apple_ref/doc/c_ref/NSRange

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.

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/c/econst/UITableViewCellStyleValue1

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

https://developer.apple.com/library/ios/documentation/iPhone/Reference/UIMenuController_Class/UIMenuController.html#//apple_ref/doc/uid/TP40008301-CH1-SW17

Saw Mission Street Grants and thought of applying:

https://www.missionmainstreetgrants.com/rules

I asked this question on CoreData but got no answers;

http://stackoverflow.com/questions/19320929/is-it-ok-to-use-dot-syntax-getters-within-an-nsmanagedobjects-custom-class

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

http://stackoverflow.com/questions/17794037/interface-builder-what-are-the-uiviews-layout-ios-6-7-deltas-for

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

https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/11_EditingandUpdatingAppInformation/EditingandUpdatingAppInformation.html#//apple_ref/doc/uid/TP40011225-CH14-SW69

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

https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html#//apple_ref/doc/uid/TP40012582-CH8-SW1

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

http://stackoverflow.com/questions/10748669/convert-uiview-to-png-image

Add custom fonts to iOS app

http://www.codigator.com/tutorials/using-custom-fonts-in-ios-application/

Audio capture project

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

https://developer.apple.com/library/ios/samplecode/AVCaptureToAudioUnit/Introduction/Intro.html#//apple_ref/doc/uid/DTS40012880

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

selector:@selector(inverted)

name:UIAccessibilityInvertColorsStatusDidChangeNotification

object:nil];

}

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.