Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: EmployeeAdmin - A PureMVC ObjectiveC / UIKit Demo  (Read 23331 times)
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« on: January 14, 2009, 07:04:33 »

This demo illustrates techniques for performing routine maintenance operations in a PureMVC-based Flex application.

The project has historically been located here: http://trac.puremvc.org/Demo_ObjectiveC_UIKit_EmployeeAdmin
It has been moved here: https://github.com/PureMVC/puremvc-objectivec-demo-uikit-employeeadmin/wiki

The author is Brian Knorr.

Originally implemented in Flex for a desktop-sized web browser, this port has been artfully reconceived by Brian to fit the mobile form factor, where transition into sub-screens is necessary.

« Last Edit: August 13, 2012, 04:44:22 by puremvc » Logged
windsurf
Newbie
*
Posts: 2


View Profile Email
« Reply #1 on: February 08, 2009, 09:42:11 »

Thanks, this is very helpful for an as3 developer who uses PureMVC to make the transition to iPhone development.
Logged
windsurf
Newbie
*
Posts: 2


View Profile Email
« Reply #2 on: February 23, 2009, 11:39:52 »

This version (v1) of the demo uses code to instantiate all of the views. It doesn't use anything from a nib/xib in Interface Builder. As a noob it took me a bit of time to figure out that if you create a View xib and associate it with a UIViewController subclass you can instantiate the UIViewController subclass to use your wysiwyg xib view. I created a couple simple views this way that have a background image and some regular buttons.

What I'm trying to figure out now is the anatomy of how to support a new view I've made where I have a xib view containing a Table control on the top and a Button Bar control on the bottom. I believe in the EmployeeAdmin demo the table views are ONLY a table in the view, so the associated controller is a UITableViewController rather than specifically a UIViewController. I'm not clear on whether I need to have two associated controllers and mediators or if I can somehow through composition just still have one associated UIViewController subclass, and somehow in its implementation hook up the table AND the button bar's buttons.

Advice appreciated :)
Logged
btknorr
Moderator
Newbie
*****
Posts: 3


View Profile Email
« Reply #3 on: February 25, 2009, 01:26:19 »

In a UIViewController you can implement viewDidLoad and publish a message containing the uiview or the uiviewcontroller (depends on what you want to mediate).  Have a mediator listening for this message and then register the appropriate mediator.

In our iphone app we wrapped the NSNotificationCenter into a custom event dispatcher like you would find in a typical UI framework.  This is how the UIKit components dispatch events that our mediators listen too.  Then of course our mediators talk to the rest of the PureMVC system through Notifications.

Hope this helps :)

Best,

Brian
Logged
slaskis
Newbie
*
Posts: 1


View Profile Email
« Reply #4 on: June 14, 2009, 08:23:27 »

Is it something new in iPhone OS 3.0 SDK that doesn't allow me to use the dot-syntax? Because when I try to compile the Employee Admin example app, following the instructions, I get these errors (8 in total):

:
/Users/slaskis/Projects/XCode/EmployeeDemo/Classes/view/UserFormMediator.m: In function '-[UserFormMediator handleNotification:]':
/Users/slaskis/Projects/XCode/EmployeeDemo/Classes/view/UserFormMediator.m:48: error: request for member 'userVO' in something not a structure or union
/Users/slaskis/Projects/XCode/EmployeeDemo/Classes/view/UserFormMediator.m:49: error: request for member 'mode' in something not a structure or union
/Users/slaskis/Projects/XCode/EmployeeDemo/Classes/view/UserFormMediator.m:51: error: request for member 'userVO' in something not a structure or union
/Users/slaskis/Projects/XCode/EmployeeDemo/Classes/view/UserFormMediator.m:52: error: request for member 'mode' in something not a structure or union

But if I change the
:
self.viewComponent.mode = EDIT; to
:
[[self viewComponent] setMode:EDIT]; (for instance) it compiles properly...
Logged
btknorr
Moderator
Newbie
*****
Posts: 3


View Profile Email
« Reply #5 on: July 17, 2009, 11:47:21 »

I have updated the source in trunk to comply with the new syntax rules in 3.0 (this actually may be a bug on Apple's part).  If you want you can get the latest from trunk or wait for a new release hopefully this week.

Best,

Brian
Logged
adrienl
Newbie
*
Posts: 3


View Profile Email
« Reply #6 on: December 04, 2009, 11:19:04 »

Hello,

I have been looking at the EmployeeAdmin example this week on XCode. Compilation goes well but when I try to run it on the current simulator (v. 3.1.2) the screen stays black and an error message appears in XCode's status bar : " Error from Debugger: Failed to launch simulated application: Unknown error.".

I can run it on my device though but it would be very nice to be able de run on the simulator. Has anyone been confronted to the same issue ?
Logged
adrienl
Newbie
*
Posts: 3


View Profile Email
« Reply #7 on: December 04, 2009, 01:44:55 »

I came to notice that the problem came with my XCode since every project does the same, even newly created projects.

It seems that cleaning and rebuilding is enough to fix the problem.
Logged
Pages: [1]
Print