Jourdein

I code, I experienced, I blog and I share my enthusiasm

RSS
people

Cross browser styling for inline-block

IE does support inline-block css styling but to which the elements are natively inline. Apply inline-block styling to strong, spans and ems.

But there’s another thing. If hasLayout is triggered on a block element, and then set that element to display inline, it will automagically become an inline-block in IE. However, you must do a *property hack to hide the display:inline from non-IE browser.

display: inline-block;
zoom: 1;
*display: inline;
No Comments | Tags: , , ,

Re-Enable Edge toggle on iPhone

any_cellular_data_configuration

Last time, my bill goes up over the roof and into the pond.. :p because the iPhone was intelligent enough to figure out the setting for the Edge APN,Username, etc. I found somewhere on the internet to stop this by entering any incorrect information in it.

However, a couple of days ago, I accidentally accept an update on iPhone carrier setting which removed the configuration page. (the page reside under Settings > General > Network > Cellular Data Network). The removal of the config page allow me to to have an internet connection, which I don’t want because I haven’t subscribe to any package, thus the rate would be insane. (I think, this carrier update is applied to Maxis subscriber only since Maxis has launch its iPhone 3G).

I found a way to revert back to re-appear the config page:

  1. SSH to /User/Library/Carrier Bundle.bundle
  2. Sort list by “latest modified” and selecting it will bring you to another folder.
  3. Find MAXIS_my.bundle and delete it (advised if you backup first in case something happen)
  4. Reboot iPhone

Reference:

No Comments | Tags: , ,

Reset Leopard to its initial state

leopard-welcome

Reset or some called it “revirginize” is putting the Leopard to state where it’s first bought/installed, where you would see welcome screen/video and setup/customize your Mac OS X Leopard installation.

1. Enter “Single User Mode” – (press Command-S during startup)
2. Check file system:

$ /sbin/fsck -fy

3. Mount root partition as writable:

$ /sbin/mount -uw /

4. Remove file .AppleSetupDone (hidden file):

$ rm /var/db/.AppleSetupDone

5. Remove user(s)

$ launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
$ dscl . -delete /Users/{username}

6. Remove user(s) Home directories:

$ rm -rf /Users/{username}

7. Reboot

I think the option 4 is the key procedure here that make the installation reset to its initial state.

Sources:

No Comments | Tags: , , , ,

Hide keyboard when a field lost focus

I’ve found 2 ways, currently, on how to hide keyboard when textfield lost focus on when user has done editing.

  • Delegate method
  • Callback for the event nbsp;nbsp;Did End On Exit

Delegate method

1
2
3
4
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
	[textField resignFirstResponder];
	return YES;
}

Very simple indeed. Just add this function in view where you want textfield to be delegated to.

Callback for event Did End On Exit

Outlines:

  • Create dummy method: -(IBAction)endEditing:(id)sender;
  • Connect event codeDid End On Exit/code to the dummy method created

References:

No Comments | Tags: , , , ,

No Radio button for iphone app

Found that there’s no easy way of creating radio button alike field as in web app for iPhone. In native iPhone app development, need to either use the UISegmentedControl or using UITableView with the items as cell and set the checkmark accessory type when user selects a cell.

These are some of the forum that I referred to:

If you like to use the checkbox style, you’d should look at the example from Apple Developer Connection (ADC), Accessory. You need to have access to ADC to be able to download.

In some thread in MacRumors, a member there pointed out that if you’ve 3-8 items, then UISegmentControl is a good replacement for radio buttons but for a larger number of items, UIPickerView is better. I have a small number of items thus UISegmentControl is of my choice. Hmm… let see what will happens.

Development status:

  • Know that, there’s no binding in iPhone development. You’ve to do it manually.
  • Managing different Nib is a lot more easier than in desktop application.
  • Memory management is important because we’re dealing with small system with small memory. IPhone has 20 seconds timer for respond before application force quit itself.
  • Some of things, you need to do programmatically than through IB as it more easier and less complex. (an example is building an interface with nav bar + tab bar and table view)
  • Finished with TabBarController and NavController. Now applying the algorithm to the app. The problem now is the the radio button. But I think I might have found the solution.
No Comments | Tags: , , , ,

I’m on iPhone app development

I’m doing native app development of oncoPDA version right now. My time is squeezed onto learning and developing at the same time but thank goodness that I have past experiences with development of Cocoa application in Objective-C language.

For web iphone version of oncology application, you can visit http://oncopda.com. If you’re developing web app for iphone, you could:

  • Refer to this site http://iwebkit.net that has some basic template/css framework for you to start developing.
  • Or you could go to this site http://code.google.com/p/iphone-universal and download latest css framework developed  by Diego Martín Lafuente.
  • Or else you can develop on Dashcode!!! I know this after I’ve finished developing the iPhone web version for OncoPDA… (the catch is you must install xcode developer for iphone, if I’m not wrong)

Just the sake of putting image into my blog :p, this is my iPhone simulator and XCode on my Mac. Still long way to go…

Developing for iPhone App

No Comments | Tags: , , , , ,

Array Controller bounded to an Array

I was scratching my head of why the heck does the my tableview does not automatically update its data.

My binding:

NSArrayController = ACIssues
Controller Class = Issue Controller (have NSArray property subviewControllers)

ACIssues has it contentArray binded to subviewControllers’s array in Issue Controller. Somehow, changes made to the array of subviewControllers in Issue Controller does not reflect on other table which I had it binded to ACIssues.

After searching the internet, I found this

http://boredzo.org/blog/archives/2008-11-26/how-to-work-with-a-bound-to-array (open in new window)

Very good one. What it said… There’re right and wrong way to bind.

The right way is by using indexed accessors. Then, your Array Controller will see any changes you’ve made. What I did was creating indexed accessor methods.

- (void)insertObject:(id)object inSubviewControllersAtIndex:(unsigned)index {
[[self subviewControllers] insertObject:object atIndex:index];
}


- (void)removeObjectFromSubviewControllersAtIndex:(unsigned)index {
[[self subviewControllers] removeObjectAtIndex: index];
}

and calling it where I wanted to change the array.

[self insertObject:obj inSubviewControllersAtIndex:(index + 1)];
[self removeObjectFromSubviewControllersAtIndex:index];

the structure of this indexed accessor:

insertObject:(id)object inKeyAtIndex:(unsigned)index

where key is the property or in my case array that is binded to the Array Controller.

No Comments | Tags: , , , , ,