iOS Question call page to tabbar

soroush_safarii

Member
Licensed User
hello
i wrote app with 3 page and i wrote each code of page in a module
no after splash app refer to main page and main page have tabBar with 3 button
in tutorial i see how to use page in tabbar but all page code in one module but now i have 3 module for 3 page

how i can Initialize TabBaritem ?
for example :

dim t1 as TabBarItem
t1.Initialize("t1",null,null)
now i have to equal page to t1 , how i can do that ?
 

soroush_safarii

Member
Licensed User
Please use [code]code here...[/code] tags when posting code.

You will need to make the page variable in each of the modules public, initialize it when the program starts and set it with tbc.Pages = Array (Module2.Page, Module3.Page)
i make variable public in each module and initialize in module but when start app , its crash
i upload project , please see
 

Attachments

  • b.zip
    143.3 KB · Views: 218
Upvote 0

soroush_safarii

Member
Licensed User
You should post the error message.
my uploaded project is very simple and very easy to see , please see that and error message :



Error occurred on line: 21 (pmain)
Object was not initialized (UIViewController)
Stack Trace: (
CoreFoundation __exceptionPreprocess + 189
libobjc.A.dylib objc_exception_throw + 49
CoreFoundation +[NSException raise:format:] + 104
B4i Example -[B4IObjectWrapper object] + 151
B4i Example -[B4IPage setTabBarItem:] + 78
B4i Example -[b4i_pmain _additem] + 1377
B4i Example -[b4i_pmain _showpageme] + 1884
B4i Example -[b4i_main _tmr_tick] + 762
CoreFoundation __invoking___ + 29
CoreFoundation -[NSInvocation invoke] + 321
B4i Example +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1842
B4i Example -[B4IShell runMethod:] + 515
B4i Example -[B4IShell raiseEventImpl:method:args::] + 2519
B4i Example -[B4IShellBI raiseEvent:event:params:] + 1623
B4i Example __24-[B4ITimer startTicking]_block_invoke + 321
libdispatch.dylib _dispatch_client_callout + 14
libdispatch.dylib _dispatch_continuation_pop + 535
libdispatch.dylib _dispatch_source_latch_and_call + 212
libdispatch.dylib _dispatch_source_invoke + 1159
libdispatch.dylib _dispatch_main_queue_callback_4CF + 653
CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
CoreFoundation __CFRunLoopRun + 2445
CoreFoundation CFRunLoopRunSpecific + 372
CoreFoundation CFRunLoopRunInMode + 123
GraphicsServices GSEventRunModal + 71
GraphicsServices GSEventRun + 80
UIKit UIApplicationMain + 148
B4i Example main + 140
libdyld.dylib start + 1
)
 
Upvote 0

soroush_safarii

Member
Licensed User
Use the debugger to go over the program execution one line after another.

@Erel I haven't run your code but I'm pretty sure that the problem is here:
psignup.pagesignup.TabBarItem = t1

This page was not initialized.
@Erel mate did you see my code ?
its correct ?
i initialize pagesignup in psignup module with this code :
pagesignup.initialized("pagesignup")
its true ? or not ?
if not how i initialze page ?
 
Last edited:
Upvote 0

soroush_safarii

Member
Licensed User
I saw your code. Your code is incorrect. See my previous post. The page was not initialized when you try to set the TabBarItem.

You must learn to use the debugger. This is a simple issue that shouldn't take more than a few minutes to solve with the debugger.
i can use debugger , and when i create break point to my code and then run the application , app pause on my break piont
and in when i equal my page to tabBaritem application crash and say object was not initialzed ,
and i dont know what i do , i initialize my page in module whit this code :
page.initalze("page1")
 
Upvote 0

soroush_safarii

Member
Licensed User
I'm sorry but I cannot debug the program for you. Bumping the question will not help.

You need to work with the debugger and find out what is happening.
dear @Erel i dont say debug for me ,
i use debug tools and when check point arrive to module1.page1.tabBarItem screan become black and dont show any error ,
if you have example for tabBar with module page please give me that i can see that and understand what i do ,
 
Upvote 0
Top