Using UIRefreshControl in UIScrollView

How to add refresh control to a scroll view First, set your uiviewcontroller self.view background to black. Then create a scroll view container and set it to red. Then have the scroll view container add a refresh control. Finally, draw an orange square and have the container add that. self.view —container ——-refresh control (operates on […]

Installing Tomcat on Mac

References: Installing Tomcat 7 on MacOSX http://www.marbelladev.com/tomcat-7-installation-in-osx-mountain-lion/ http://neutronote.com/?p=233 find out version of java you have

If you don’t have java you need to download the latest version. Go to java for instructions. Download apache tomcat’s tar gz binary file and unzip it in your Downloads folder. Extract the downloaded binary distribution onto ~/Download/apache-tomcat-7.0.30 . […]

Thread Safety in ios

ref – http://quellish.tumblr.com/post/101831085987/implementing-thread-safety-in-cocoa-ios You have just introduced “threads” to your application, because doing everything on the same thread as the UI was starting to noticeably bog things down. At some point you have run into strange crashes or exceptions. Your application no longer behaves as it used to. One problem you have likely introduced is […]

Yono – Period Tracking

Updating of the calendar’s view for given Changing Status The MeStatusViewController needs to communicate with CalendarViewController whenever a user has changed status. We do this by notifications because we are communicating ViewController to ViewController in a MVC setting. MeStatusViewController

Once an update is notified by MeStatusViewController, we call CalendarViewcontroller’s updateCalendarView using previously saved period […]

Yono – Logging out

Logout – back to default status Basically when we log out, 2 basic things happen. 1) We are at the settings view controller where we create/log in…etc. We that settings controller so that we’re back to the main tabs view controller.m 2) we empty period dates in our calendar. That way all the period flows […]

Thread Basics (Instantiations)

SomeClass header

SomeClass implementation

main

log output: Thread B processing on object 0x7fe839416a70 ‘s method, member variable address: 0x7fe839416a78, number just changed to 0 Thread B processing on object 0x7fe839416a70 ‘s method, member variable address: 0x7fe839416a78, number just changed to 1 Thread A processing on object 0x7fe83960e340 ‘s method, member variable address: […]

Threads Basics (static, class methods, and singletons)

Class methods are shared by threads All methods who run a class method on a class name are using the same class and running through that one method. That class method acts as an entry point. You do this by looking at the address of self.

If you run couple of threads through this […]

Flow Dates ( period dates )

Taking in flow dates and updating your Calendar The app starts and the user presses on the flow dates button on the top right. User enters 2 different flow dates and clicks on “Save History” on the top left. PeriodHistoryViewController’s “Save History” is a back button. Its responder is:

After the user selects the […]

Factory Methods in Objective C and iOS

ref – http://stackoverflow.com/questions/19450940/what-is-the-purpose-of-using-a-factory-method-in-objective-c-context Objective-C does not have constructor methods that are available in other programming languages. Factory methods are essentially Objective C’s constructor methods. They allow you to allocate memory for your object and initialize the values. In your class, add methods with this pattern:

Then in main, you can do:

It saves […]

static in objective c vs java

ref – http://stackoverflow.com/questions/4965048/static-variables-in-objective-c-what-do-they-do http://stackoverflow.com/questions/2649213/in-laymans-terms-what-does-static-mean-in-java OBJECTIVE C STATIC VARIABLES In both C and Objective-C, a static variable is a variable that is allocated for the entire lifetime of a program. This is in contrast to automatic variables whose lifetime exists during a single function call and dynamically-allocated variables like objects, which can be released from memory […]