Uploaded October 2012 | Updated September 2026, 2 weeks ago
Subscribe to our channel here for notifications on new video trainings. For more videos on technology, visit our website at http://www.techytube.com.
By pavel@techytube, for more from this author visit:
techytube.com/author/pavel
We use the UIProgressView class to depict the progress of a task over time. An example of a progress bar is the one shown at the bottom of the Mail application when it's downloading messages.
The UIProgressView class provides properties for managing the style of the progress bar and for getting and setting values that are pinned to the progress of a task.
For an indeterminate progress indicator—or, informally, a "spinner" — use an instance of the UIActivityIndicatorView class(which we will discuss in a later video).
In iOS 5 and up, we have a lot of customisation possibilities. For example, we can set our own progress image instead of the default blue color indicating the progress. Also we can set the progress tint color and the track image. We can achieve all these thing either graphically directly using the menus provided by Xcode, or programmatically.
For more details, please visit Apple's Online Documentation at:
developer.apple.com/library/ios/#documentation/uikit/reference/UIProgressView_Class/Reference/Reference.html
Subscribe to our channel here for notifications on new video trainings. For more videos on technology, visit our website at http://www.techytube.com.
By pavel@techytube, for more from this author visit:
techytube.com/author/pavel
We use the UIProgressView class to depict the progress of a task over time. An example of a progress bar is the one shown at the bottom of the Mail application when it's downloading messages.
The UIProgressView class provides properties for managing the style of the progress bar and for getting and setting values that are pinned to the progress of a task.
For an indeterminate progress indicator—or, informally, a "spinner" — use an instance of the UIActivityIndicatorView class(which we will discuss in a later video).
In iOS 5 and up, we have a lot of customisation possibilities. For example, we can set our own progress image instead of the default blue color indicating the progress. Also we can set the progress tint color and the track image. We can achieve all these thing either graphically directly using the menus provided by Xcode, or programmatically.
For more details, please visit Apple's Online Documentation at:
developer.apple.com/library/ios/#documentation/uikit/reference/UIProgressView_Class/Reference/Reference.html




![Archiving and unarchiving objects in Objective-C
Subscribe to our channel here for notifications on new video trainings. For more videos on technology, visit our website at http://www.techytube.com.
By pavel@techytube, for more from this author visit:
http://www.techytube.com/author/pavel
There are situations when we want to save the state of our objects to the system, for example when our app has to go in the background, or to terminate.
Of course, we can do our way for saving our objects, but iOS SDK provides us an elegant way for doing that by using NSKeyedArchiver - to archive objects, and NSKeyedUnarchiver - to unarchive objects.
But in order for those methods to work correctly, we need to implement 2 instance methods in the class we want to be able to archive, or unarchive.
These methods are mandatary in such situations, and should look like this:
- (void)encodeWithCoder:(NSCoder *)coder
{
[coder encodeObject:somePropertyOrField forKey:@KeyName];
}
- (id)initWithCoder:(NSCoder *)coder
{
self.propertyName = [coder decodeObjectForKey:@KeyName1];
fieldName = [coder decodeObjectForKey:@KeyName2];
return self;
}
somePropertyOrField must be a property or a field of our class; @KeyName, @KeyName1 ..., @KeyNamen may be arbitrary names we choose.
To archive (save the object on the File System), we use:
[NSKeyedArchiver archiveRootObject:objectName toFile:@/Users/pavel/myObjectState.plist];
which create the .plist file (which a special XML-format file in iOS) at the indicated path.
To unarchive (restore an object state from a file), we use:
MyClass *newObjectName = [NSKeyedUnarchiver unarchiveObjectWithFile:@/Users/pavel/myObjectState.plist];
which initializes the new object with the corresponding values from the .plist file. Archiving and unarchiving objects in Objective-C](https://i.ytimg.com/vi/KSIU8zRi7zk/mqdefault.jpg)





