Saving action sheet Values/User Defaults - ios

So in my app I'm using a Action sheet which displays which animations to use. Everything is implemented, however, I'm having trouble using user defaults to save the selected row and then pass that along to the rest of my code. I've used user defaults before on UISwitch, but this is different I suppose.
The portion I'm using is a UITableView. in the didselectrow:
//Animation Picker
[tableView deselectRowAtIndexPath:indexPath animated:NO];
NSString *actionSheetTitle = #"Choose your style.";
BlockActionSheet *sheet = [BlockActionSheet sheetWithTitle:actionSheetTitle];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[sheet addButtonWithTitle:#"Zoom Out" block:^{
[cell.textLabel setText:[NSString stringWithFormat:#"Animation Style: Zoom Out"]];
//User Defaults
[prefs setObject:#"Zoom Out" forKey:#"Zoom"];
cellTitle = #"Zoom Out";
}];
[sheet addButtonWithTitle:#"Drop In" block:^{
[cell.textLabel setText:[NSString stringWithFormat:#"Animation Style: Drop In"]];
//User Defaults
[prefs setObject:#"Drop In" forKey:#"Drop"];
cellTitle = #"Drop In";
}];
[sheet setDestructiveButtonWithTitle:#"Cancel" block:nil];
[sheet showInView:self.view];
[prefs synchronize];
[tableView reloadData];
Which should send the info to use the proper animationController:
-(void)infoButtonAction:(id)sender {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults synchronize];
if ([userDefaults stringForKey:#"Zoom"]) {
AppInfoViewController * info = [[AppInfoViewController alloc] init];
UINavigationController *vc = [[UINavigationController alloc] initWithRootViewController:info];
self.animationController = [[ZoomAnimationController alloc] init];
vc.transitioningDelegate = self;
[self presentViewController:vc animated:YES completion:nil];
[info release];
}
else if ([userDefaults stringForKey:#"Drop"]) {
AppInfoViewController * info = [[AppInfoViewController alloc] init];
UINavigationController *vc = [[UINavigationController alloc] initWithRootViewController:info];
self.animationController = [[DropAnimationController alloc] init];
vc.transitioningDelegate = self;
[self presentViewController:vc animated:YES completion:nil];
[info release];
}
NSLog(#"App Info");
}
Also should update the cell displaying which animationController was selected:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs synchronize];
[cell.textLabel setText:[NSString stringWithFormat:#"Animation Style:"]];
if ([prefs stringForKey:#"Zoom"]){
[cell.textLabel setText:[NSString stringWithFormat:#"Animation Style: Zoom Out"]];
}
else if ([prefs stringForKey:#"Drop"]) {
[cell.textLabel setText:[NSString stringWithFormat:#"Animation Style: Drop In"]];
}
UIView *animation = [[UIView alloc] initWithFrame:cell.frame];
animation.backgroundColor = [UIColor colorWithRed:0.176 green:0.176 blue:0.176 alpha:1];
cell.backgroundView = animation;
However, nothing is getting saved. What am I missing?
Thank you for any help.
UPDATE: 1/3
I managed to get everything working with the updated code above. The only thing now is it won't save the style I choose. If I choose Drop In, and re open the table, it reverts back to Zoom Out. How can I fix this?

Take one String object that
NSString *OneString = [NSString stringWithFormat: selectedValue];
and Use that OneString in if condition and rest of the code.

Related

UITableView cell touch event only work on small part of the cell

I have a table view with multi cell.
All cells are handling the click listener very well except the two last cells.
The first one only handles clicks when I press on the red highlighted part and the second does not.
Here is a screenshot. Can anyone please tell me how to know the reason for this problem knowing that all other cells are working fine.
EDIT
This is the cell element
and this is the code
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)newIndexPath{
[tableView deselectRowAtIndexPath:newIndexPath animated:YES];
KYDrawerController *elDrawer = (KYDrawerController*)self.navigationController.parentViewController;
MainViewControllerObjc *viewController = [[UIStoryboard storyboardWithName:#"Forsa" bundle:nil] instantiateViewControllerWithIdentifier:#"MainController"];
UINavigationController *navController=[[UINavigationController alloc]initWithRootViewController:viewController];
ForsaDataManager *sharedManager = [ForsaDataManager instance];
SocialResponse *social = [sharedManager socialLinks];
DrawerItem *test = [DrawerItem new];
test = [self.dataSource objectAtIndex: newIndexPath.row];
if ([test.tag isEqualToString:#"Login"]) {
[self openLogin];
} else if ([test.tag isEqualToString:#"Logout"]) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:0 forKey:#"user-id-key"];
[defaults setObject:#"" forKey:#"user-name-key"];
[defaults setObject:#"" forKey:#"user-email-key"];
[defaults setObject:#"" forKey:#"user-profile-key"];
[defaults synchronize];
dispatch_async(dispatch_get_main_queue(), ^{
UIStoryboard *sb = [UIStoryboard storyboardWithName:#"Forsa" bundle:nil];
SplashViewController * secondViewController = (SplashViewController *)[sb instantiateViewControllerWithIdentifier:#"splash"];
[self presentViewController:secondViewController animated:YES completion:nil];
});
} else if ([test.tag isEqualToString:#"Register"]){
[self openRegister];
} else if ([test.tag isEqualToString:#"Favorite"]){
viewController.categoryId = -2;
viewController.categoryName = #"التفضيلات";
} else if ([test.tag isEqualToString:#"Facebook"]){
[self openURL:social.facebook];
} else if ([test.tag isEqualToString:#"Twitter"]){
[self openURL:social.twitter];
} else if ([test.tag isEqualToString:#"Youtube"]){
[self openURL:social.youtube];
} else if ([test.tag isEqualToString:#"Contact Us"]){
[self openContactUs];
} else if ([test.tag isEqualToString:#"About Us"]){
int tag = 56;
[self openAboutUs:(tag)];
} else if ([test.tag isEqualToString:#"Terms"]){
int tag = 57;
[self openAboutUs:(tag)];
} else if ([test.tag isEqualToString:#"Main"]){
viewController.categoryId = -1;
} else if([test.tag hasPrefix:#"Service_"]){
NSString *string = [test.tag stringByReplacingOccurrencesOfString:#"Service_" withString:#""];
int catId = [string intValue];
viewController.categoryId = catId;
viewController.categoryName = test.title;
}
elDrawer.mainViewController=navController;
[elDrawer setDrawerStateWithState:(DrawerStateClosed) animated:(YES)];
}
Since the test is in iPhone X , there is a touch area reserved instead of the home button that's removed ( bottom safeAreaLayoutGuide ) , you need to inset your table's bottom , or increase the constant value of the bottom constraint at least On iPhone-X

Saving and restoring NSMutablearray to NSUserdefaults

I am writing a app that needs to save and restore nsmutablearrays to populate a table view. The array will save but won't overwrite once i reset everything. i find that the values are combining together and is giving me unreliable averages... code is below. also i have various view controllers that have this lap function...
// code that adds items to table view and saves a version of the array to nsmutablearray
NSUserDefaults *prefs = [[NSUserDefaults alloc]
initWithSuiteName:#"group.com.DJ.TSTML"];
[tableItems3 insertObject:TimeString2 atIndex:0];
// time string is the time as a nsstring
[tableItems4 addObject:[NSNumber numberWithFloat:seconds2]];
[tableview reloadData];
[prefs setObject:self.tableItems4 forKey:#"SavedArray3"];
[prefs setObject:self.tableItems3 forKey:#"SavedArray4"];
// this is saving to insurer defaults
NSString *newString = [NSString stringWithFormat:#"%lu", (unsigned long)tableItems3.count];
[Commentcount setText:newString];
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
NSNumber *average = [tableItems4 valueForKeyPath:#"#avg.self"];
Average.text = [formatter stringFromNumber:average];
NSLog(#"Sucess");
[prefs synchronize];
} }
Restoring the array :
NSUserDefaults *prefs = [[NSUserDefaults alloc]
initWithSuiteName:#"group.com.DJ.TSTML"];
// code used to erase current values in the table view and restore from NSUserDefaults
tableItems3 = [[NSMutableArray alloc] init];
tableItems4 = [[NSMutableArray alloc] init];
[tableview reloadData];
NSMutableArray *RestoreArray1 = [[prefs objectForKey:#"SavedArray4"]mutableCopy];
NSMutableArray *RestoreArray2 = [[prefs objectForKey:#"SavedArray3"]mutableCopy];
[tableItems3 addObjectsFromArray:RestoreArray1];
[tableItems4 addObjectsFromArray:RestoreArray2];
if (tableItems3 == nil) {
tableItems3 = [[NSMutableArray alloc] init];
tableItems4 = [[NSMutableArray alloc] init];
}
[tableview reloadData];
NSLog(#"%#",tableItems4);
}
}
Thank you in advance for any help!
My issue to be clear is that every time i save to nsuserdefaults instead of overwriting the previous array it just keeps the old array and combines with the new one
Ok so i answered my own question. As someone brought up it was combining because i was retrieving without overwriting it first. the following code is what worked...
NSString *Clearstring = [prefs objectForKey:#"Clear?"];
// i created a nsstring that when the method for restarting would change accordingly.
// so when someone would navigate to this view controller this would fire.
// if clear is yes i would prevent the code that controled the restore function from restoring and prepare
// it if it was needed to be restored again.
if ([Clearstring isEqualToString:#"Yes"]) {
tableItems3 = [[NSMutableArray alloc] init];
tableItems4 = [[NSMutableArray alloc] init];
[prefs setObject:self.tableItems4 forKey:#"SavedArray3"];
[prefs setObject:self.tableItems3 forKey:#"SavedArray4"];
[prefs setObject:#"NO" forKey:#"Clear?"];
[tableview reloadData];
}
else{
tableItems3 = [[NSMutableArray alloc] init];
tableItems4 = [[NSMutableArray alloc] init];
[tableview reloadData];
NSMutableArray *RestoreArray1 = [[prefs objectForKey:#"SavedArray4"]mutableCopy];
NSMutableArray *RestoreArray2 = [[prefs objectForKey:#"SavedArray3"]mutableCopy];
[tableItems3 removeAllObjects];
[tableItems4 removeAllObjects];
[tableItems3 addObjectsFromArray:RestoreArray1];
[tableItems4 addObjectsFromArray:RestoreArray2];
if (tableItems3 == nil) {
tableItems3 = [[NSMutableArray alloc] init];
tableItems4 = [[NSMutableArray alloc] init];
}
[tableview reloadData];
NSLog(#"%#",tableItems4);
}
}

fill multiple nsmutabledictionary with data from API

i saved results from API to nsmutabledictionary. In this API is paging after 15 results (1,2,3, etc).
I need to fill resultDictionary with results from API.
My code:
self.resultDictionary = [[NSDictionary alloc] init];
self.resultDictionary = [self.api sendDataViaPostAndFormDataWithTwoParameters:#"email" with:[[NSUserDefaults standardUserDefaults] valueForKey:#"email"] parameterTwo:#"heslo" with:[[NSUserDefaults standardUserDefaults] valueForKey:#"heslo"] onUrl:[NSString stringWithFormat:#"http://***", [[NSUserDefaults standardUserDefaults] valueForKey:#"id"], [[NSUserDefaults standardUserDefaults] valueForKey:#"token"], page] withMethod:#"POST" success:^(BOOL success) {
} failure:^(NSString *fail) {
NSLog(#"%#", fail);
}];
It works fine - it shows 15 results. But, when i scroll down in tableview and after 15 index load next page in api, it shows next 15 results. I need to join both (30results / old and new).
I tried add entries... but no effect.
Could you help me please?
edit:
my rest of code with edit from Ashish
#implementation testingTableViewController {
NSMutableDictionary * resultDictionary;
}
-(void)reloadData:(int)page {
// set selected NO
if ([[NSUserDefaults standardUserDefaults] valueForKey:#"id"] == NULL) {
loginViewController *login = [[loginViewController alloc] init];
login.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:login animated:NO];
} else {
SHOW_NAVIGATION_BAR
self.api = [[API alloc] init];
self.temp = [self.api sendDataViaPostAndFormDataWithTwoParameters:#"email" with:[[NSUserDefaults standardUserDefaults] valueForKey:#"email"] parameterTwo:#"heslo" with:[[NSUserDefaults standardUserDefaults] valueForKey:#"heslo"] onUrl:[NSString stringWithFormat:#"http://*****/=&page=%d", [[NSUserDefaults standardUserDefaults] valueForKey:#"id"], [[NSUserDefaults standardUserDefaults] valueForKey:#"token"], page] withMethod:#"POST" success:^(BOOL success) {
NSLog(#"OK načteno");
} failure:^(NSString *fail) {
NSLog(#"%#", fail);
}];
}
}
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
resultDictionary = [NSMutableDictionary dictionary];
self.temp = [[NSDictionary alloc] init];
[self reloadData:1];
[self.tableView reloadData];
[self.tableView setNeedsLayout];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self.tableView registerClass:[TableViewCell class] forCellReuseIdentifier:#"cell"];
self.chatButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
self.commentButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
UIButton *commentButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
commentButton.frame = CGRectMake(15, 0, 20, 20);
[commentButton setImage:[UIImage imageNamed:#"chat"] forState:UIControlStateNormal];
[commentButton addTarget:self action:#selector(page1) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:commentButton];
UIButton *chatButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
chatButton.frame = CGRectMake(65, 0, 20, 20);
[chatButton setImage:[UIImage imageNamed:#"like"] forState:UIControlStateNormal];
[chatButton addTarget:self action:#selector(page2) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:chatButton];
}
-(void)page1 {
[self reloadData:1];
[resultDictionary addEntriesFromDictionary:self.temp];
[self.tableView reloadData];
}
-(void)page2 {
[self reloadData:2];
[resultDictionary addEntriesFromDictionary:self.temp];
[self.tableView reloadData];
}
When click at first button, result is 15, if i again click on first button, result is still 15 instead 30
Thank you for any response
As per your code
self.resultDictionary = [[NSDictionary alloc] init];
self.resultDictionary = [self.api sendDataViaPostAndFormDataWithTwoParameters:#"email" with:[[NSUserDefaults standardUserDefaults] valueForKey:#"email"] parameterTwo:#"heslo" with:[[NSUserDefaults standardUserDefaults] valueForKey:#"heslo"] onUrl:[NSString stringWithFormat:#"http://***", [[NSUserDefaults standardUserDefaults] valueForKey:#"id"], [[NSUserDefaults standardUserDefaults] valueForKey:#"token"], page] withMethod:#"POST" success:^(BOOL success) {
} failure:^(NSString *fail) {
NSLog(#"%#", fail);
}];
You are not using NSMutableDictionary. Create instance of NSMutableDictionary at top of the class.
NSMutableDictionary * resultDictionary;
Initialize it in viewDidLoad method
self.resultDictionary = [NSMutableDictionary dictionary];
Finally in your code for fetching result form server.
NSDictionary *tempDict = [self.api sendDataViaPostAndFormDataWithTwoParameters:#"email" with:[[NSUserDefaults standardUserDefaults] valueForKey:#"email"] parameterTwo:#"heslo" with:[[NSUserDefaults standardUserDefaults] valueForKey:#"heslo"] onUrl:[NSString stringWithFormat:#"http://***", [[NSUserDefaults standardUserDefaults] valueForKey:#"id"], [[NSUserDefaults standardUserDefaults] valueForKey:#"token"], page] withMethod:#"POST" success:^(BOOL success) {
[self.resultDictionary addEntriesFromDictionary:tempDict];
} failure:^(NSString *fail) {
NSLog(#"%#", fail);
}];

How can i implement UIActivityIndicatorView during performing search functionality?

I’m building an article reading app.I’m fetching the data from server in JSON format and load into UITableViewController.In search part when user
enter something for a search it will take time to load data into a UITableView.I’m unable to implement UIActivityIndicatorView in between the time search result takes to load
data in UITableViewController.
Here is my Code:
-(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
NSString *searchText=searchBar.text;
[self.mySearchBar resignFirstResponder];
NSString *trimmedString = [searchText stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]];
if (trimmedString.length==0) {
isFilter=NO;
UIAlertView *noConn = [[UIAlertView alloc] initWithTitle:#"ERROR" message:#"Please enter your something in search bar" delegate:self cancelButtonTitle:nil otherButtonTitles:#"ok", nil];
[noConn show];
}
else
NSString *searchNew = [trimmedString stringByReplacingOccurrencesOfString:#" " withString:#"%20"];
isFilter=YES;
#try {
[label removeFromSuperview];
_Title1 = [[NSMutableArray alloc] init];
_Author1 = [[NSMutableArray alloc] init];
_Images1 = [[NSMutableArray alloc] init];
_Details1 = [[NSMutableArray alloc] init];
_link1 = [[NSMutableArray alloc] init];
_Date1 = [[NSMutableArray alloc] init];
NSString* myURLString = [NSString stringWithFormat:#“www.example.com&search=%#", searchNew];
NSURL *url = [NSURL URLWithString:myURLString];
NSData* data = [NSData dataWithContentsOfURL:url];
if ((unsigned long)data.length > 3)
{
NSArray *ys_avatars = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
if(ys_avatars){
for (int j=0;j<ys_avatars.count;j++)
{
[_Title1 addObject:ys_avatars[j][#"title"]];
[_Author1 addObject: ys_avatars[j][#"author"]];
[_Images1 addObject: ys_avatars[j][#"featured_img"]];
[_Details1 addObject:ys_avatars[j][#"content"]];
[_link1 addObject:ys_avatars[j][#"permalink"]];
NSString *newStr=[ys_avatars[j][#"date"] substringToIndex:[ys_avatars[j] [#"date"] length]-3];
[_Date1 addObject:newStr];
}
}
else
{
NSLog(#"error");
}
[self.myTableView reloadData];
}
}
else{
[self.myTableView reloadData];
self.tableView.separatorColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0];
label = [[UILabel alloc] initWithFrame:CGRectMake(90, 100, 200, 100)];
label.text=#"No Article Found";
label.backgroundColor = [UIColor clearColor];
[self.view addSubview:label];
}
}
#catch (NSException *exception) {
}
}
}
you can do this right after the searchBarSearchButton is clicked.
then you add this line inside the cellForRowAtIndexPath:
-(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
[_activityIndicator startAnimating];
your code
}
next:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexpath.row == [your_array_of_content count]-1)
{
[_activityIndicator stopAnimating];
}
}
dataWithContentsOfURL is a synchronous API. One way to achieve what you want is to use NSURLConnection APIs to load the date from an URL asynchronously. You should also be hooking into the below listed delegate methods to start and stop the activity indicator.
connection:didReceiveResponse:
connectionDidFinishLoading:
I would also like to suggest you to use libraries like AFNetworking which will give you the before and after hooks as callback blocks, which will be little cleaner on the coding front.
Create the indicator:
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:
UIActivityIndicatorViewStyleWhiteLarge];
[activityIndicator setCenter:CGPointMake(view.frame.size.width/2.0, view.frame.size.height/2.0)];
activityIndicator.hidesWhenStopped = YES;
activityIndicator.color = [UIColor blackColor];
//add it to the view
[self.view addSubview:activityIndicator];
//start the animation
[activityIndicator startAnimating];
and when you want to dismiss it:
[activityIndicator stopAnimating];

saving user defaults [iOS]

I saw a couple of examples but I cannot figure out what's going wrong when trying to save my text field input and reload it when restarting the app.
I have something like this in my .m file (.h file only has a <UITextViewDelegate>);
#implementation C4WorkSpace{
UITextView *textField;
C4Button *okButton;
C4Label *savedText;
}
-(void)setup {
//add text field
CGRect textViewFrame = CGRectMake(20.0f, 20, self.canvas.width-40, 124.0f);
textField = [[UITextView alloc] initWithFrame:textViewFrame];
textField.returnKeyType = UIReturnKeyDone;
[textField becomeFirstResponder];
textField.delegate = self;
//textField.hidden=true;
[self.view addSubview:textField];
okButton=[C4Button buttonWithType:ROUNDEDRECT];
[okButton setTitle:#"Save" forState:NORMAL];
okButton.center=self.canvas.center;
[self.canvas addUIElement:okButton];
[okButton runMethod:#"saveDefault" target:self forEvent:TOUCHUPINSIDE];
savedText=[C4Label labelWithText:#"default"];
savedText.center=CGPointMake(self.canvas.center.x, self.canvas.center.y+40);
[self.canvas addLabel:savedText];
}
-(void)saveDefault{
NSUserDefaults *defaults=[NSUserDefaults standardUserDefaults];
[defaults setObject:textField.text forKey:#"userName"];
[defaults synchronize];
C4Log(#"defaults: %#",defaults);
C4Log(#"defaults: %#", [defaults objectForKey:#"userName"]);
savedText.text=textField.text;
}
-(void)viewDidLoad{
NSMutableString *text=[[NSUserDefaults standardUserDefaults] objectForKey:#"userName"];
C4Log(#"loadedText:%s", text);
textField.text=text;
savedText.text=text;
}
#end
I'm not sure what exactly is going wrong, but when I restart the app the loadedText is always: "¯8*:å". Doesn't matter what I saved.
I found the easiest solution is to set in
ViewDidLoad
text=[[NSUserDefaults standardUserDefaults] objectForKey:#"userName"];
and in setup
if (text!=nil) {
textField.text=text;
}
Where does Setup method is call ? I think in viewDidLoad you initialize, but setup method called earlier.
You don't save this info,so button don't recognizer or load info and set text before initialization.
in setup method load info
UItextView *k = [UItextView alloc] init];
k.text = [[NSUserDefaults standardUserDefaults] objectForKey:#"userName"];
and take a look what will be.
UPDATE:
That's wrong;
[c4workspace loadInfoFromDefaults];
[c4workspace alloc]init]; (calls viedidload method with load info)
You need
[c4workspace alloc]init];
[c4workspace loadInfoFromDefaults];
Please post code where you create c4WorkSpace object.
UPDATE 2:
-(void)setup {
//add text field
CGRect textViewFrame = CGRectMake(20.0f, 20, self.canvas.width-40, 124.0f);
textField = [[UITextView alloc] initWithFrame:textViewFrame];
textField.returnKeyType = UIReturnKeyDone;
[textField becomeFirstResponder];
textField.delegate = self;
//textField.hidden=true;
[self.view addSubview:textField];
okButton=[C4Button buttonWithType:ROUNDEDRECT];
[okButton setTitle:#"Save" forState:NORMAL];
okButton.center=self.canvas.center;
[self.canvas addUIElement:okButton];
[okButton runMethod:#"saveDefault" target:self forEvent:TOUCHUPINSIDE];
savedText=[C4Label labelWithText:#"default"];
savedText.center=CGPointMake(self.canvas.center.x, self.canvas.center.y+40);
[self.canvas addLabel:savedText];
}
- (void) setTextView
{
textField.text=[[NSUserDefaults standardUserDefaults] objectForKey:#"userName"];
savedText.text=[[NSUserDefaults standardUserDefaults] objectForKey:#"userName"];
}
So you call this like:
C4WorkSpace *c4 = [C4WorkSpace alloc] init];
[c4 setup]
[c4 setTextView];

Resources