last day (49 days later) » 

12:01
0
A: Passing to correct view controller on table view datasource selection

Govindarao KondalaIn didSelectRowAtIndexPath, you need to keep condition based on login or not , like you did in moreScreenElements method - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; if ([V...

if user is not loged in i could go inside switch loop cases .my code as u said . it throw out of the switch case paste.ubuntu.com/14162030
what exactly do you have issue ?"it throw out of the switch case" means ? if your indexpath.row is equal to any of your switch case , that will execute
if i select if user not loged in plist data source index then it s not redirecting to controller. on particular row selection.i have given my code above
why 2 switch it s not good way, i guess in one switch it should be done.
See , you have two cases 1) LoggedIn 2)Gest . If case: LoggedIn, you have different actions and same for Gest. If you have common actions in both cases , you don't need two switch cases . If you need different actions , you need to implement two
then how can i frame conditon sir . plz could u let me know by code. i need to pass to correct view controller on row selection
i have to redirect to specific view controller based on row selction thats y i used enum and switch
12:01
can I see your both plists and enum? so I can create sample code sample and give you in 15min
@Govindarao Kondala
this s my plist
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
MoreCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MoreCell"];


cell.lblMoreCategory.text = moreScreenItems[indexPath.row][@"title"];

cell.imageOfMoreCategory.image = [UIImage imageNamed :moreScreenItems[indexPath.row][@"image"]];

return cell;
}
typedef enum
{
RowSelectedMethodMyOrder= 0,
RowSelectedMethodTrackOrder,
RowSelectedMethodMyAddresses,
RowSelectedMethodMyWallet,
RowSelectedMethodSetting,
RowSelectedMethodInviteFriends,
RowSelectedMethodRatetheApp,
RowSelectedMethodHelp,
RowSelectedMethodLogout,
RowSelectedMethodLogin

}RowSelectedMethod;
this s enum
yup
I found the issue. so shall I suggest better way
?
yes
bro
12:07
your each dict in plist like bellow
<dict>
<key>title</key>
<string>My Orders</string>
<key>image</key>
<string>order.png</string>
</dict>
means you have total two keys
title,image
yup
bro
now just add one more key called "index "
for each
in index what value
should i pass
0 1 2 3
it is based in your enum
ok
in index just one empty key
of integer type
rit
12:09
in your enum My Orders ====> RowSelectedMethodMyOrder = 0
so
<dict>
<key>title</key>
<string>My Orders</string>
<key>image</key>
<string>order.png</string>
<key>index</key>
<string>0</string></dict>
RowSelectedMethodMyOrder= 0,
RowSelectedMethodTrackOrder = 1,
RowSelectedMethodMyAddresses = 2,
RowSelectedMethodMyWallet,
RowSelectedMethodSetting,
RowSelectedMethodInviteFriends,
RowSelectedMethodRatetheApp,
RowSelectedMethodHelp,
RowSelectedMethodLogout,
RowSelectedMethodLogin
so based on above enum you can give index in your plist
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ok
i m doing
after changing you plist , show me both
I can verify wether it is proper or not
sure
check bro
@GovindaraoKondala
12:22
show me the plist
hello, can you show me plist structere ?
second plist please
1st one is good
show me second one
do both r ok
that's great
good work
hmm
now
12:29
now come to - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath method
ok
onboard
first let us call moreScreenElements
NSarray *allRowDetails = [self moreScreenElements]
ok
NSdictonery *tempObject= [allRowDetails objectAtIndex:indexpath.row]
12:31
@GovindaraoKondala i need help can you help me?
@Birendra will do, can you give me few minutes
@GovindaraoKondala ok
I will complete first with @Imran
@GovindaraoKondala when you free tell me
@Imran NSNumber *indexValue = [tempObject valueForKey:@"index"]
12:32
done
now your switch became like
switch (indexValue.integerValue)
{
@Imran is it working ?
@Birendra hi. what do you want?
jus 1 sec
sure, will wait
@GovindaraoKondala i have to edit audio in video during the play
@GovindaraoKondala you have any idea?
@GovindaraoKondala or sample link or code then give it me for reference
2
A: How do i Merge Audio and Video files in iOS and how to save it?

hs.chandrause this i found this somewhere in net, i don't remember,.... NSString *fileNamePath = @"audio.caf"; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *oldappSettingsPath = [docu...

@Birendra this may help you
@Imran
12:37
@GovindaraoKondala
yes
good one
bro
but is this not jugad by using 2 swicthes
yes
it s working
no need two switches
remove all things
12:38
removed
keep single switch
ok let me try
sure
no need to check loggedin or not
NSNumber *indexValue = [tempObject valueForKey:@"index"]
switch (indexValue.integerValue)
{
@Imran
tried ?
ya got it bro
it was really a nice expalnantion
really
u r experinced dev
kudos u sir
u r a great tutor
:)
this is the simple way while we are dealing with comon actions
can you accespt my answer ?
12:43
sure
@Imran
thanks
could u slightly mody by adding add index value for plist
give your comment in that answer
may i know ur skype id or gmail id
i dont any help if in case need clarification
we can not share as per mu company rules
12:44
i could
sure
you can ping me stackoverflow
he our room
so here
I am always here
feel free to ask anything
thanks bro
u will not get hurt
if i ask basics
12:45
i can ask
sure thanks a lot bro
I am happy to help you to explain apple splling even
:)
thanks bro
can you upvote and accespt
thanks
i done
i am alone in my comapny and doing app it s really a like a survival
if i get stackover flow support and people like u
Hi
there is one performence issue in your code @Imran
there ?@Imran
12:53
yes
tell bro
sure
NSarray *allRowDetails = [self moreScreenElements]
if you call this everytime while selecting table cell , that will access yout file system to load data from your plist
so what I am suggesting is
i changed
i m using the same array which i have in view did load
can you paste your didselect method code here
yes that's great
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];

NSDictionary *tempObject= [moreScreenItems objectAtIndex:indexPath.row];
NSNumber *indexValue = [tempObject valueForKey:@"index"];

switch (indexValue.integerValue)
{
case RowSelectedMethodMyOrder:
{
VCMyOrderViewController *myOrderVC = [self.storyboard instantiateViewControllerWithIdentifier:@"VCMyOrderViewController"];
[self.navigationController pushViewController:myOrderVC animated:YES];
- (NSArray *)moreScreenElements
{
NSString *plistPath;

if ([VCConfiguration isUserAlreadyLoggedIn])
plistPath = [[NSBundle mainBundle] pathForResource:@"MoreScreenOptionsData" ofType:@"plist"];
else
plistPath = [[NSBundle mainBundle] pathForResource:@"Guest_More" ofType:@"plist"];

moreScreenItems = [[NSArray alloc] initWithContentsOfFile:plistPath];
return moreScreenItems;
}
good one..keep it up
12:56
thanks
bro one issue
case RowSelectedMethodLogout:
{
[VCConfiguration clearLoggedUserData];
moreScreenItems = [[NSArray alloc] initWithArray:[self moreScreenElements]];
[self.tblMore reloadData];

VCLoginViewController * loginVC = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"VCLoginViewController"];
[loginVC setIsLoginForCart:NO];
UINavigationController * navControllerLogin = [[UINavigationController alloc] initWithRootViewController:loginVC];
[navControllerLogin setNavigationBarHidden:YES];
if i m log out and use login after login table s not reloding with more plist array
sorry, not getting
i have two cases
log out
and login
in both cases i m redirecting to login view controller
when i logout and do login in thaT case i m just presenting view controller
in same screen
where plist gets load
but values r not changing
i did this
in table row
            [self.tblMore reloadData];
also
can you please call moreScreenElements and asign that values to your preloaded array
and than reload
than it will change
@Imran
okay ?
there ?
@Imran
13:11
yes
sorry cant get u
hi
can you call following method
- (NSArray *)moreScreenElements
{
NSString *plistPath;

if ([VCConfiguration isUserAlreadyLoggedIn])
plistPath = [[NSBundle mainBundle] pathForResource:@"MoreScreenOptionsData" ofType:@"plist"];
else
plistPath = [[NSBundle mainBundle] pathForResource:@"Guest_More" ofType:@"plist"];

moreScreenItems = [[NSArray alloc] initWithContentsOfFile:plistPath];
return moreScreenItems;
}
before you reload table
and togle isUserAlreadyLoggedIn value also while you are doing logout or login time
case RowSelectedMethodLogin:
{
VCLoginViewController * loginVC = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"VCLoginViewController"];
[loginVC setIsLoginForCart:NO];
UINavigationController * navControllerLogin = [[UINavigationController alloc] initWithRootViewController:loginVC];
[navControllerLogin setNavigationBarHidden:YES];
[self presentViewController:navControllerLogin animated:YES completion:nil];
[self moreScreenElements];
ok
asign [self moreScreenElements]; result to moreScreenItems array
after succesful login you need to do change all values
so you need to write all you reload functionality in dissmis VCLoginViewController
ok let me chk bro
13:21
case RowSelectedMethodLogout:
{
[VCConfiguration clearLoggedUserData];
moreScreenItems = [[NSArray alloc] initWithArray:[self moreScreenElements]];
[self.tblMore reloadData];

VCLoginViewController * loginVC = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"VCLoginViewController"];
[loginVC setIsLoginForCart:NO];
UINavigationController * navControllerLogin = [[UINavigationController alloc] initWithRootViewController:loginVC];
[navControllerLogin setNavigationBarHidden:YES];
moreScreenItems = [[NSArray alloc] initWithArray:[self moreScreenElements]];
[self.tblMore reloadData];
not get called
when i used break
keep your viewcontroller.m code in pastebin and share
I am little confused here
remove if there is any confidential details
let me check and getback to you
Table data in VCMoreViewController is not updating
am I right ?
@Imran
yes
yup
k
hi
do one thing
there ?@Imran
I think
case RowSelectedMethodLogout:
this case time, it work properly
am I right ?
13:46
yes
in that case it s working fine
but in login case it s not working
13:56
okay
VCLoginViewController * loginVC = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"VCLoginViewController"];
[loginVC setIsLoginForCart:NO];
UINavigationController * navControllerLogin = [[UINavigationController alloc] initWithRootViewController:loginVC];
[navControllerLogin setNavigationBarHidden:YES];
[self presentViewController:navControllerLogin animated:YES completion:nil];
if ([VCConfiguration isUserAlreadyLoggedIn])
{
moreScreenItems = [[NSArray alloc] initWithArray:[self moreScreenElements]];
hi
just add following lines in your viewWillAppear
moreScreenItems = [[NSArray alloc] initWithArray:[self moreScreenElements]];
[self.tblMore reloadData];
okay ?
14:11
yesbhai
14:23
any luck ?
14:35
bhai
yes it works
14:50
thanks a lot

  last day (49 days later) »