i had some images in resultstring i want to display it in tableview - ios-simulator

i had some images in resultstring ,resultstring is what i get from the server ,it contains images ,i want that images and display it in tableview
my code is
viewdidload
{
NSString *urlVal = #"http://at.azinova.info/green4care/iphone/viewImage.php?id=";
NSString *urlVal1 = [urlVal stringByAppendingString:selectedCountryw];
NSURL *url1 = [NSURL URLWithString:urlVal1];
//NSURL *url1 = [NSURL URLWithString:urlVal];
NSString *resultString = [NSString stringWithContentsOfURL:url1 encoding:NSUTF8StringEncoding error:nil];
NSArray *arycountries1 = [resultString componentsSeparatedByString:#","];
UIAlertView *loginalert = [[UIAlertView alloc] initWithTitle:#" Message" message:resultString delegate:self
cancelButtonTitle:#"OK" otherButtonTitles:nil];
[loginalert show];
[loginalert release];
//arraycountries = [[NSArray alloc]initWitho:arycountries1];
arraycountries = [[NSArray alloc]initWithArray: arycountries1];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return [arraycountries count];
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.imageView.image = [UIImage imageNamed:[arraycountries objectAtIndex:indexPath.row]];
// Configure the cell...
return cell;
}
please help
thankzzzzz

What you described is much like a message borad with images, there is a twitter open source project tweetero: http://code.google.com/p/tweetero/ You can take a look at MessageListController and ImageLoader.
In generally, you could do like this:
1) Send async request to server to get message date(not images)
2) reload the table data, and send the image loader request for each uiimageview.
3) set the uiimageview when the image is loaded. A default loading image can be used until the real image is loaded.

Related

Method cellForRowAtIndexPath method was not get called

Am a beginner in iOS, am creating an application with the help of table view. I just run my application, while running the app, the app does not calling the method cellForRowIndexPath. Am using Json as web service. In the output screen, the parsing data is shown but it is not get display in simulator. i put breakpoint and i understood the cellForRowIndexPath path was not called. I drag datasourse and data delegate to files onner of xib file. but nothing is occurring... the table view is get displaying but there is no content... am screwed.. Any one please help me...
#implementation MSPackagesController
#synthesize packageTable;
#synthesize packages;
#synthesize mainCtrl;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
-(void)viewDidLoad
{
[super viewDidLoad];
}
-(void)parseData {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.animationType = MBProgressHUDAnimationFade;
hud.detailsLabelText = #"Loading...";
MSJsonParser *parser = [[MSJsonParser alloc]initWithParserType:kPackagesParsing];
parser._parserSource = self;
[parser requestParsingWithUrl:PACKAGES_LIST_URL];
}
-(void)sharePackageFromCell:(UIButton*)btn
{
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.animationType = MBProgressHUDAnimationFade;
hud.detailsLabelText = #"Loading...";
NSString *title = [[self.packages objectAtIndex:btn.tag] packageName];
/*NSURL *imgUrl = [NSURL URLWithString:[[self.promotions objectAtIndex:btn.tag] picture]];
NSData *imgdata = [NSData dataWithContentsOfURL:imgUrl];
UIImage *image = [UIImage imageWithData:imgdata];*/
// NSURL *imgUrl = [NSURL URLWithString:[[self.packages objectAtIndex:btn.tag] picture]];
NSString *desc = [[self.packages objectAtIndex:btn.tag] packageDescription];
NSString *message = #"Visit GlamZapp in AppStore";
UIActivityViewController *activityCtrl = [[UIActivityViewController alloc]initWithActivityItems:[NSArray arrayWithObjects:title,desc,message, nil] applicationActivities:nil];
activityCtrl.excludedActivityTypes = #[UIActivityTypePrint,UIActivityTypePostToWeibo,UIActivityTypeMessage,UIActivityTypeAssignToContact];
activityCtrl.completionHandler = ^(NSString *activityType, BOOL completed)
{
NSLog(#" activityType: %#", activityType);
NSLog(#" completed: %i", completed);
};
[self.mainCtrl presentViewController:activityCtrl animated:YES completion:^{
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
}];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [packages count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
MSPackagesCell *cell = (MSPackagesCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *cells = [[NSBundle mainBundle]loadNibNamed:[Common checkDeviceforController:#"MSPackagesCell"] owner:nil options:nil];
for (id eachObject in cells) {
cell = eachObject;
break;
}
//cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
// Configure the cell...
// NSURL *imgUrl = [NSURL URLWithString:[[self.promotions objectAtIndex:indexPath.row]picture]];
//[cell.promoImg setImageWithURL:imgUrl placeholderImage:[UIImage imageNamed:#"slider_dummy.jpg"] andSize:cell.promoImg.frame.size];
cell.PackageName.text = [[self.packages objectAtIndex:indexPath.row] packageName];
cell.PackageDescription.text = [[self.packages objectAtIndex:indexPath.row] packageDescription];
// NSMutableAttributedString *strikedPrice = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:#"%# %#",CURRENCY_UNIT,[[self.packages objectAtIndex:indexPath.row] packageAmount] ] ];
// [strikedPrice addAttribute:NSStrikethroughStyleAttributeName value:[NSNumber numberWithInt:2] range:NSMakeRange(0, [strikedPrice length])];
//cell.oldPriceLabel.attributedText = strikedPrice;
cell.PriceLabel.text = [NSString stringWithFormat:#"%# %#",CURRENCY_UNIT,[[self.packages objectAtIndex:indexPath.row] packageAmount] ];
//[string appendFormat:#"%#\r\n", message];
// cell.promocodelabel.text = [NSString stringWithFormat:#"Promo code: %#",[[self.packages objectAtIndex:indexPath.row] promoCode]];
cell.ShareButton.tag = indexPath.row;
[cell.ShareButton addTarget:self action:#selector(sharePackageFromCell:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// MSPackageDetailsController *promDet = [[MSPackageDetailsController alloc]initWithNibName:[Common checkDeviceforController:#"MSPackageDetailsController"] bundle:nil];
// promDet.delegate = self;
// promDet.offerId = [[self.packages objectAtIndex:indexPath.row] promoId];
// promDet.title = [[self.packages objectAtIndex:indexPath.row] promoTitle];
// [self.delegate didSelectPromotion:promDet];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
-(void)foundPackagesData:(NSArray *)packa
{
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
self.packages = packa;
[self.packageTable reloadData];
}
-(void)connectionFailed
{
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
}
I think you have not added UITableviewDataSource and UITableViewDelegate in your .h file
Add UITableViewDataSource,UITableViewDelegate in interface (.h) file
#interface MSPackagesController : UIViewController <UITableViewDataSource,UITableViewDelegate>

Posting user profile pic to twitter giving Error 131

When trying to post a users profile pic to twitter, I am getting Error code 131 response back:
2013-12-06 19:17:29.854 Tweetly[8131:60b] {
errors = (
{
code = 131;
message = "Internal error";
}
);
}
Twitters website lists this:
"Corresponds with an HTTP 500 - An unknown internal error occurred."
Here is my code:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
//Code for store image
[picker dismissViewControllerAnimated:YES completion:nil];
UIImage *image = [info objectForKey:#"UIImagePickerControllerOriginalImage"];
UIImage *scaledImage = [self imageWithImage:image convertToSize:CGSizeMake(500, 500)];
NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(scaledImage)];
[self uploadPictureWithData:imageData];
}
- (UIImage *)imageWithImage:(UIImage *)image convertToSize:(CGSize)size {
UIGraphicsBeginImageContext(size);
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
UIImage *destImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return destImage;
}
- (void)uploadPictureWithData:(NSData *)imageData {
// Get the twitter feed
NSURL *requestURL = [NSURL URLWithString:#"https://api.twitter.com/1.1/account/update_profile_image.json"];
// Set up proper parameters
NSMutableDictionary *timelineParameters = [[NSMutableDictionary alloc] init];
[timelineParameters setObject:imageData forKey:#"image"];
[timelineParameters setObject:#"1" forKey:#"skip_status"];
// Create the Social Request
SLRequest *postRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodPOST URL:requestURL parameters:timelineParameters];
postRequest.account = self.delegate.userAccount;
// Perform the request
[postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
// Check if we reached the reate limit
if ([urlResponse statusCode] == 429) {
// Rate limit reached
// Display an alert letting the user know we have hit the rate limit
UIAlertView *twitterAlert = [[UIAlertView alloc] initWithTitle:kRateLimitTitle
message:kRateLimitMessage
delegate:nil
cancelButtonTitle:#"Ok"
otherButtonTitles:nil];
[twitterAlert show];
return;
}
// Check if there was an error
if (error) {
NSLog(#"Error: %#", error.localizedDescription);
return;
}
// Check if there is some response data
if (responseData) {
NSError *jsonError = nil;
NSMutableArray *feedData = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:&jsonError];
if (!jsonError) {
// Check the response data
NSLog(#"%#", feedData);
} else {
// Alert the user with the error
UIAlertView *twitterAlert = [[UIAlertView alloc] initWithTitle:kErrorTitle
message:kErrorMessage
delegate:nil
cancelButtonTitle:#"Ok"
otherButtonTitles:nil];
[twitterAlert show];
}
} else {
// Alert the user with the error
UIAlertView *twitterAlert = [[UIAlertView alloc] initWithTitle:kErrorTitle
message:kErrorMessage
delegate:nil
cancelButtonTitle:#"Ok"
otherButtonTitles:nil];
[twitterAlert show];
}
});
}];
}
Any idea what the issue might be? I initially thought it was because the image was too big, so I added the method for scaling the image down to 500 x 500, but I get the same error.
This error happens while running on both the device and the simulator.
Does anyone see where the problem is or have any extra insight? Thanks!
In my tests, images larger than 1000x1000px are not downscaled synchronously, throwing the 131 response code. Undocumented, unfortunately.
Make sure the image is <700kb and smaller than 1000x1000px.
https://dev.twitter.com/rest/reference/post/account/update_profile_image

SQlite Database ios UITableView

I Have Change the Whole Database...
Now I Have Two Tables that Display Below
First Table:- Category Table
Cat_id CategoryName
====================================
1 Jesus
2 Buddha
3 BillGates
Second Table :- SayingTable
Say_id Cat_id Sayings
===================================
1 1 Never Say False
2 1 God Bless you
3 1 Be a Good Boy
4 2 Make a Peaceful World
5 2 Never Lie with the People
and I Have Used UITableView in My Firstview Controller
That Display Like Below Image
When i Click on Jesus Christ Cell..Or any Other cell then it Crash..
My Code is Below
FirstViewController.m
- (void)viewDidLoad
{
dataaray = [[NSMutableArray alloc] init];;
[dataaray addObject:#"Jesus Christ"];
[dataaray addObject:#"Budhdha"];
[dataaray addObject:#"BillGates"];
jesus = [[NSMutableArray alloc] init];
Buddha = [DatabaseOperation SelectCategory:2];
Buddha = [Buddha valueForKey:#"Saying"];
NSLog(#"Buddha Bhagwan Category=%#",Buddha);
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [self.dataaray count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *identifier = #"Cellidentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (cell==nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
cell.textLabel.text = [dataaray objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
DetailViewController *mydetail = [[DetailViewController alloc] initWithNibName:#"DetailViewController" bundle:nil];
if ([[dataaray objectAtIndex:indexPath.row] isEqual:#"Jesus Christ"])
{
mydetail.flag=1;
int SelectedRow = (indexpath.row+1);
jesus = [DatabaseOperation SelectCategory:SelectedRow];
jesus = [jesus valueForKey:#"Saying"];
NSLog(#"Jesus Category===%#",jesus);
mydetail.Jesus2Array = [jesus mutablecopy]; //Note Jesus2 is an Array of detailviewcontroller
}
else if ([[dataaray objectAtIndex:indexPath.row] isEqualToString:#"Budhdha"])
{
mydetail.flag=2;
SelectedRow = (indexpath.row+1);
Buddha = [DatabaseOperation SelectCategory:SelectedRow];
jesus = [jesus valueForKey:#"Saying"];
NSLog(#"Jesus Category===%#",jesus);
mydetail.Buddha2Array = [Buddha mutableCopy]; //Note Jesus2 is an Array of detailviewcontroller
}
DetailviewController.m
- (void)viewDidLoad
{
NSLog(#"Flag Value===%d",flag);
NSLog(#"Jesus 2 Array===%#",Jesus2Array);
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (flag==1)
{
return [Jesus2Array count];
}
if(flag==2)
{
return [Buddha2array count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
if (flag==1)
{
cell.textLabel.text = [Jesus2Array objectAtIndex:indexPath.row];
}
DatabaseOperation.h
#import <Foundation/Foundation.h>
#import "DatabaseOperation.h"
#import <sqlite3.h>
#interface DatabaseOperation : NSObject
{
}
+(void)Check_Create_Database;
+(NSMutableArray*)SelectCategory:(int)Category_id;
DatabaseOperation.m
#import "DatabaseOperation.h"
#import <sqlite3.h>
static NSString *dbPath;
static NSString *databaseName=#"Message.sqlite";
#implementation DatabaseOperation
+(void)Check_Create_Database
{
dbPath =[[NSHomeDirectory() stringByAppendingPathComponent:#"Documents"] stringByAppendingPathComponent:databaseName];
BOOL success;
NSFileManager *fm=[NSFileManager defaultManager];
success=[fm fileExistsAtPath:dbPath];
if(success){
return;
}
NSString *dbPathFromApp=[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:databaseName];
NSLog(#"dbPathFromApp = %#",dbPathFromApp);
[fm copyItemAtPath:dbPathFromApp toPath:dbPath error:nil];
}
+(NSMutableArray*)SelectCategory:(int)Category_id
//+(NSMutableArray*)SelectedCategory
{
sqlite3 *database;
NSMutableArray *dic=[[NSMutableArray alloc] init];
NSString *SAYING;
if(sqlite3_open([dbPath UTF8String] , &database) == SQLITE_OK)
{
NSString *sqlTmp=[NSString stringWithFormat:#"Select * from SayingTable Where Cat_id=%d",Category_id];
const char *sqlStmt=[sqlTmp UTF8String];
sqlite3_stmt *cmp_sqlStmt;
if(sqlite3_prepare_v2(database, sqlStmt, -1, &cmp_sqlStmt, NULL)==SQLITE_OK)
{
while(sqlite3_step(cmp_sqlStmt)==SQLITE_ROW)
{
NSLog(#"SQL Statements====%s",sqlStmt);
SAYING=[NSString stringWithUTF8String:(char *) sqlite3_column_text(cmp_sqlStmt, 2)];
NSMutableDictionary *dicObj=[[NSMutableDictionary alloc] init];
[dicObj setValue:[NSString stringWithFormat:#"%#",SAYING] forKey:#"Saying"];
[dic addObject: dicObj];
}
}
sqlite3_finalize(cmp_sqlStmt);
}
sqlite3_close(database);
When I Click the Cell then Detailview Controller is Not Loading.....i don't know whats Wrong in my Code Please Help..
Thank You...

GPUImageView Integration in my project

What I am trying to do is this.
- (void)viewDidLoad
{
[super viewDidLoad];
NSURL *url2 = [[NSBundle mainBundle] URLForResource:#"NAN" withExtension:#"mov"];
GPUImageMovie *movie2 = [[GPUImageMovie alloc] initWithURL:url2];
movie2.playAtActualSpeed = YES;
filter0 = [[GPUImageSepiaFilter alloc] init];
[movie2 addTarget:filter0];
[filter0 addTarget:view0]; // view0 is a GPUImageView taken in nib
[self recordVideo];
isRecording = YES;
[movie2 startProcessing];
[movieWriter setCompletionBlock:^{
if (isRecording) {
[self stopRecording];
isRecording = NO;
} }];
}
-(void)recordVideo {
NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:#"file.mov"];
NSURL *url = [NSURL fileURLWithPath:path];
NSFileManager *fm = [NSFileManager defaultManager];
[fm removeItemAtPath:path error:nil];
movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:url size:CGSizeMake(640, 480)];
[filter0 addTarget:movieWriter];
[movieWriter startRecording];
}
-(void)stopRecording {
[movieWriter finishRecording];
}
But this is not working at all. I always get a black video with this code. There is no crash, I get a black video with the same duration as of original video. Has anyone faced the same issue. Kindly help.
Any help would be great.

ZUUIRevealController - Memory allocations keeps on increasing & slow UIAlertView & UIActionsheet

I am starting with new iOS app in which I have to use Reveal control. So I planned to use great ZUUIRevealController library. I just created UI for 2 - 3 screens . In one of those screen I have to shown UIAlertView & UIActionsheet. But I realised that UIAlertView & UIActionsheet shows very slowly (it adds black overlay first & then shows UIAlertView/UIActionsheet, kind of alert view hangs while showing. Animation is not smooth). I didn't added any logic for coding just created the UI. I didn't use any background thread / dispatch_asyn(). So there is no issue of updating UI from background thread. So I checked the memory leaks & allocations. I didn't see any memory leaks , but memory allocations keeps on increasing while I reveal the menu & push new view controller. It doesn't decrese when I pop the view controller. Here are the screenshots :
1) When app launches
2) After some time , when I push new view controller, pop view controller
I know ZUUIRevealController library creates new instance of view controller every time I select a row from Menu. So I crated the instance variables of view controllers in .h file , but still I have same problem.
Here is my code
// AppDelegate.m
// On SplashViewController , I decide whether to show menu or Login screen
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.splashViewController = [[SplashViewController alloc]initWithNibName:#"SplashViewController" bundle:nil];
self.window.rootViewController = self.splashViewController;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
[self customizeUIControlsAppearance];
return YES;
}
// SplashViewController.m
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
BOOL isLoggedIn = YES;
if(isLoggedIn){
[self showMenuViewController];
}
else{
[self showStartUpViewController];
}
}
-(void)showStartUpViewController
{
StartUpViewController *startUpViewController = [[StartUpViewController alloc]initWithNibName:#"StartUpViewController" bundle:nil];
UINavigationController *navController=[[UINavigationController alloc] initWithRootViewController:startUpViewController];
[self presentViewController:navController animated:NO completion:^{
}];
}
-(void)showMenuViewController
{
MenuViewController *menuViewController=[[MenuViewController alloc] init];
CategoryViewController *categoryViewController=[[CategoryViewController alloc]initWithNibName:#"CategoryViewController" bundle:nil];
categoryViewController.isViewControllerShownFromMenu = YES;
UINavigationController *navController=[[UINavigationController alloc] initWithRootViewController:categoryViewController];
RevealController *revealController=[[RevealController alloc] initWithFrontViewController:navController rearViewController:menuViewController];
[self presentViewController:revealController animated:NO completion:^{
}];
}
// MenuViewController.m
// SettingsViewController & NewsViewController are decalred in .h file with property & syntheszie
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
RevealController *revealController = [self.parentViewController isKindOfClass:[RevealController class]] ? (RevealController *)self.parentViewController : nil;
// Switch using Section Number
switch (indexPath.section) {
case OTHER_SECTION:
switch (indexPath.row) {
case NEWS:
[self showNewsViewControllerUsingRevealController:revealController];
break;
case SETTINGS:
[self showSettingsViewControllerUsingRevealController:revealController];
break;
default:
break;
}
break;
default:
break;
}
}
#pragma mark - Show News & Settings View Controllers
-(void)showNewsViewControllerUsingRevealController:(RevealController*)revealController
{
if ([revealController.frontViewController isKindOfClass:[UINavigationController class]] && ![((UINavigationController *)revealController.frontViewController).topViewController isKindOfClass:[NewsViewController class]])
{
if(!self.newsViewController)
self.newsViewController = [[NewsViewController alloc] initWithNibName:#"NewsViewController" bundle:nil];
self.newsViewController.isViewControllerShownFromMenu = YES;
UINavigationController *navigationController= [[UINavigationController alloc] initWithRootViewController:self.newsViewController];
[revealController setFrontViewController:navigationController animated:NO];
}
else
{
[revealController revealToggle:self];
}
}
-(void)showSettingsViewControllerUsingRevealController:(RevealController*)revealController
{
if ([revealController.frontViewController isKindOfClass:[UINavigationController class]] && ![((UINavigationController *)revealController.frontViewController).topViewController isKindOfClass:[SettingsViewController class]])
{
if(!self.settingsViewController)
self.settingsViewController= [[SettingsViewController alloc] initWithNibName:#"SettingsViewController" bundle:nil];
self.settingsViewController.isViewControllerShownFromMenu = YES;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self.settingsViewController];
[revealController setFrontViewController:navigationController animated:NO];
}
else
{
[revealController revealToggle:self];
}
}
// Code for shwoing UIAlertView & UIActionsheet
-(void)showAlertWithTitle:(NSString*)title andMessage:(NSString*)message
{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:title message:message delegate:nil cancelButtonTitle:#"OK" otherButtonTitles: nil];
[alert show];
}
-(void)btnInviteTapped:(id)sender event:(UIEvent*)event
{
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:NSLocalizedString(#"FRIENDS_VC:INVIT_ACTIONSHEET_TITLE", nil) delegate:self cancelButtonTitle:NSLocalizedString(#"FRIENDS_VC:ACTIONSHEET_CANCEL_BUTTON",nil) destructiveButtonTitle:nil otherButtonTitles:NSLocalizedString(#"FRIENDS_VC:ACTIONSHEET_SMS_BUTTON",nil),NSLocalizedString(#"FRIENDS_VC:ACTIONSHEET_EMAIL_BUTTON",nil), nil];
actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
[actionSheet showInView:self.view];
}
By the way I have 11 menu items.
My Login & Regsiter flow is not embedded in MenuViewController. On Login & REgsiter , UIAlertView & UIActionSheet shows smoothly.
Any idea whats going wrong here ? Did I make some mistake in coding ?
Why my UIAlertView & UIActionsheet are not showing smoothly ?
Any kind of help is appreciated. Thanks.

Resources