Dont work edit order buttons

19 views
Skip to first unread message

Oscar Pedrero

unread,
May 14, 2012, 8:55:43 AM5/14/12
to myLauncher
I add all perfect and work all ok, but when i going to edit order of
icon have error:

2012-05-14 14:52:06.678 LocaFm[13164:b903] -[NSCFString count]:
unrecognized selector sent to instance 0x4c3f4a0
2012-05-14 14:52:06.680 LocaFm[13164:b903] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString
count]: unrecognized selector sent to instance 0x4c3f4a0'
*** Call stack at first throw:
(
0 CoreFoundation 0x00ff85a9
__exceptionPreprocess + 185
1 libobjc.A.dylib 0x0114c313
objc_exception_throw + 44
2 CoreFoundation 0x00ffa0bb -
[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00f69966 ___forwarding___ +
966
4 CoreFoundation 0x00f69522
_CF_forwarding_prep_0 + 50
5 LocaFm 0x00011442 -[MyLauncherView
beginEditing] + 114
6 LocaFm 0x0000eb91 -[MyLauncherView
itemHoldTimer:] + 97
7 Foundation 0x007d5749 __NSFireTimer +
125
8 CoreFoundation 0x00fd98c3
__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
9 CoreFoundation 0x00fdae74 __CFRunLoopDoTimer
+ 1220
10 CoreFoundation 0x00f372c9 __CFRunLoopRun +
1817
11 CoreFoundation 0x00f36840
CFRunLoopRunSpecific + 208
12 CoreFoundation 0x00f36761 CFRunLoopRunInMode
+ 97
13 GraphicsServices 0x00cf81c4 GSEventRunModal +
217
14 GraphicsServices 0x00cf8289 GSEventRun + 115
15 UIKit 0x00045c93 UIApplicationMain
+ 1160
16 LocaFm 0x0000370a main + 170
17 LocaFm 0x00002a85 start + 53
)
terminate called throwing an exception(lldb)

And the line is:
if(self.pages.count <= maxPageCount)
{
[self.pages addObject:[NSMutableArray array]];
self.pageControl.numberOfPages = self.pages.count;
self.pagesScrollView.contentSize =
CGSizeMake(self.pages.count*self.pagesScrollView.frame.size.width,

self.pagesScrollView.frame.size.height);
}

Can you help me please?

Thkns 4 your support!

Jarada

unread,
May 20, 2012, 8:27:48 AM5/20/12
to mylau...@googlegroups.com
Hi there,

What you have to remember is that myLauncher stores the pages and each page in an array

Pages {
  Page {
    Icon 1,
    Icon 2,
    Icon 3,
  }
  Page {
    Icon 4,
    Icon 5,
    Icon 6,
  }
}

So the above would be an NSArray of two NSArray's, each containing three MyLauncherItem's. This would place three icons on the first page, and three on the second page.

So, to reorder the icons, you need to take the original NSArray of pages, and move the item's between the page NSArray's, and then pass the root pages NSArray back into the pages variable of MyLauncherView. For example, to move Icon 6 to the first page, you would edit the Pages root NSArray so it looked like this:

Pages {
  Page {
    Icon 1,
    Icon 2,
    Icon 3,
    Icon 6,
  }
  Page {
    Icon 4,
    Icon 5,
  }
}

I hope this helps with the reordering!

Cheers,

Jarada

Oscar Pedrero

unread,
May 21, 2012, 1:02:21 PM5/21/12
to mylau...@googlegroups.com
Hi Jarada!!!

My problem is when implment in viewcontroller and not in appdelegate... if implment in AppDelegate all works fine, but when i implemented in my app in a viewcontroller dont work order.

Sorry for my english its very bad :P

Jarada

unread,
May 21, 2012, 1:11:34 PM5/21/12
to mylau...@googlegroups.com
How are you editing the order of the icons? Through code or by holding with your finger and dragging?

Could you show me the code you are using for your RootViewController (or equivalent)?

Oscar Pedrero

unread,
May 21, 2012, 1:16:16 PM5/21/12
to mylau...@googlegroups.com
When holding icon...

navigationController = [[UINavigationController alloc] initWithRootViewController:
                            [[RootViewController alloc] init]];
    navigationController.navigationBar.tintColor = COLOR(181, 91, 0);
    navigationController.view.backgroundColor = [UIColor clearColor];
    //vistaHome = [[HomeViewController alloc] init];
   
    [VistaCentral addSubview:navigationController.view];

Jarada

unread,
May 23, 2012, 6:14:35 AM5/23/12
to mylau...@googlegroups.com
Hey,

Can you show me your loadView method of your RootViewController where you set the Pages variable?

Cheers

Oscar Pedrero Feliciano

unread,
May 23, 2012, 10:02:14 AM5/23/12
to mylau...@googlegroups.com
Of course!!!!

-(void)loadView
{   
    [super loadView];
    self.title = @"Canales";
   
    [[self appControllers] setObject:[BolasViewController class] forKey:@"BolasViewController"];
 
    [self.launcherView setDelegate:self];
   
    if(![self hasSavedLauncherItems])
    {
        [self.launcherView setPages:[NSMutableArray arrayWithObjects:
                                     [NSMutableArray arrayWithObjects:
                                      [[MyLauncherItem alloc] initWithTitle:@"Live"
                                                                 iPhoneImage:@"g_Live"
                                                                   iPadImage:@"g_Live"
                                                                      target:@"BolasViewController"
                                                                 targetTitle:@"Item 1 View"
                                                                   deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 2"
                                                                 iPhoneImage:@"g_NewPop"
                                                                   iPadImage:@"g_NewPop"
                                                                      target:@"BolasViewController"
                                                                 targetTitle:@"Item 2 View"
                                                                   deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 3"
                                                                 iPhoneImage:@"g_DanceHits"
                                                                   iPadImage:@"g_DanceHits"
                                                                      target:@"BolasViewController"
                                                                 targetTitle:@"Item 3 View"
                                                                   deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 4"
                                                                 iPhoneImage:@"g_TechnoRave"
                                                                   iPadImage:@"g_TechnoRave"
                                                                      target:@"BolasViewController"
                                                                 targetTitle:@"Item 4 View"
                                                                   deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 5"
                                                                 iPhoneImage:@"g_House"
                                                                   iPadImage:@"g_House"
                                                                      target:@"BolasViewController"
                                                                 targetTitle:@"Item 5 View"
                                                                   deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 6"
                                                                 iPhoneImage:@"g_Trance"
                                                                   iPadImage:@"g_Trance"
                                                                      target:@"BolasViewController"
                                                                 targetTitle:@"Item 6 View"
                                                                   deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 7"
                                                                 iPhoneImage:@"g_ChillOut"
                                                                   iPadImage:@"g_ChillOut"
                                                                      target:@"BolasViewController"
                                                                 targetTitle:@"Item 7 View"
                                                                   deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 8"
                                                                iPhoneImage:@"g_Sublime"
                                                                  iPadImage:@"g_Sublime"
                                                                     target:@"BolasViewController"
                                                                targetTitle:@"Item 8 View"
                                                                  deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 9"
                                                                iPhoneImage:@"g_Remember"
                                                                  iPadImage:@"g_Remember"
                                                                     target:@"BolasViewController"
                                                                targetTitle:@"Item 9 View"
                                                                  deletable:NO],
                                      nil],
                                     [NSMutableArray arrayWithObjects:
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 10"
                                                                 iPhoneImage:@"g_ProgressiveHouse"
                                                                   iPadImage:@"g_ProgressiveHouse"
                                                                      target:@"BolasViewController"
                                                                 targetTitle:@"Item 10 View"
                                                                   deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 11"
                                                                 iPhoneImage:@"g_TechHouse"
                                                                   iPadImage:@"g_TechHouse"
                                                                      target:@"BolasViewController"
                                                                 targetTitle:@"Item 11 View"
                                                                   deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 12"
                                                                 iPhoneImage:@"g_Hard"
                                                                   iPadImage:@"g_Hard"
                                                                      target:@"BolasViewController"
                                                                 targetTitle:@"Item 10 View"
                                                                   deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 13"
                                                                iPhoneImage:@"g_Ambient"
                                                                  iPadImage:@"g_Ambient"
                                                                     target:@"BolasViewController"
                                                                targetTitle:@"Item 8 View"
                                                                  deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 14"
                                                                iPhoneImage:@"g_Sessions"
                                                                  iPadImage:@"g_Sessions"
                                                                     target:@"BolasViewController"
                                                                targetTitle:@"Item 14 View"
                                                                  deletable:NO],
                                      [[MyLauncherItem alloc] initWithTitle:@"Item 15"
                                                                iPhoneImage:@"g_Indie"
                                                                  iPadImage:@"g_Indie"
                                                                     target:@"BolasViewController"
                                                                targetTitle:@"Item 15 View"
                                                                  deletable:NO],
                                      nil],
                                     nil]];
       
    }
    self.view.backgroundColor = [UIColor clearColor];

}

Jarada

unread,
Jul 1, 2012, 10:35:16 AM7/1/12
to mylau...@googlegroups.com
Hey there!

Apologies for the slow reply, the past month or so has been hectic.

I have not been able to replicate your problem. Are you still having this issue? Would you be willing to share with me more code related to your project if so?

Cheers
Reply all
Reply to author
Forward
0 new messages