Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-14-2009, 10:40 PM   #1 (permalink)
New Member
 
Join Date: May 2009
Location: Beijing, CN
Posts: 23
Send a message via MSN to iwind Send a message via Skype™ to iwind
Default How to convert word to lower or upper case in xcode?

In xcode editor, i want to change a piece of code to upper case, how can i do it quickly? such as change " my_tunner_charge" to "MY_TUNNER_CHARGE"?

There is any hotkeys? Or xcode never support this?
iwind is offline   Reply With Quote
Old 05-14-2009, 11:08 PM   #2 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 82
Default

Quote:
Originally Posted by iwind View Post
In xcode editor, i want to change a piece of code to upper case, how can i do it quickly? such as change " my_tunner_charge" to "MY_TUNNER_CHARGE"?

There is any hotkeys? Or xcode never support this?
Same way you would in every program ~ use Find & Replace and turning off the ignore case option. Just hit command F to bring it up for one doc, command-shift F for multiple documents.
Lars is offline   Reply With Quote
Old 05-15-2009, 12:40 AM   #3 (permalink)
New Member
 
Join Date: May 2009
Location: Beijing, CN
Posts: 23
Send a message via MSN to iwind Send a message via Skype™ to iwind
Default

Quote:
Originally Posted by Lars View Post
Same way you would in every program ~ use Find & Replace and turning off the ignore case option. Just hit command F to bring it up for one doc, command-shift F for multiple documents.
Thank you for replying! In fact, in some other IDEs(on Windows Operation System), i only need to press CTRL+L to make the selected words to lower case, and CTRL+U to make them to upper case.

Find & Replace maybe a choice, but i have to knock keys and input the word AGAIN!

Is there a shortcut to do this, just like CTRL+L and CTRL+U?
iwind is offline   Reply With Quote
Old 05-15-2009, 09:04 AM   #4 (permalink)
Objective-C Code Monkey
 
deansx's Avatar
 
Join Date: May 2009
Location: Mountain View, CA
Posts: 127
Default Make Word Upper/Lower Case

I'm not aware of a default key in Xcode to do this, but I've reprogrammed several keys to make my life easier.

There's a great post on this subject here:

Mac OS X Key Bindings - Erasetotheleft

One of their examples covers your exact requirement...

...
"~u" = "uppercaseWord:"; /* M-u */
"~l" = "lowercaseWord:"; /* M-l */

...

If you only want the definition to apply to Xcode, you need to modify (create if it doesn't exist):

~/Library/KeyBindings/PBKeyBinding.dict

There are good discussions of this here:

TypeOneError Studios™ Custom Key Bindings in XCode for TextMate users

and here:

Delete Line hot-key - Stack Overflow

----
BluMtnWerx
iPunt
iPuck
deansx is offline   Reply With Quote
Old 05-15-2009, 11:00 AM   #5 (permalink)
New Member
 
Join Date: May 2009
Location: Beijing, CN
Posts: 23
Send a message via MSN to iwind Send a message via Skype™ to iwind
Default

Quote:
Originally Posted by deansx View Post
I'm not aware of a default key in Xcode to do this, but I've reprogrammed several keys to make my life easier.

...
After following the two links mentioned, I can use CTRL+SHIFT+U/L to change the words' case now!

Thanks you.

The last thing I need to point out is I MUST use Xcode Default Key Binding Sets, or It will do not work.

Last edited by iwind; 05-15-2009 at 11:12 AM.
iwind is offline   Reply With Quote
Old 05-15-2009, 09:33 PM   #6 (permalink)
Objective-C Code Monkey
 
deansx's Avatar
 
Join Date: May 2009
Location: Mountain View, CA
Posts: 127
Default

I'm glad that the technique worked for you. It's nice to have the key mappings that we love.
deansx is offline   Reply With Quote
Old 06-28-2009, 06:05 PM   #7 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 25
Default

Quote:
Originally Posted by iwind View Post
In xcode editor, i want to change a piece of code to upper case, how can i do it quickly? such as change " my_tunner_charge" to "MY_TUNNER_CHARGE"?

There is any hotkeys? Or xcode never support this?
Go into xcode preferences -> KeyBindings ->Text Key Bindings -> Capitialize Word -> assign a key

now it'll uppercase when you select some text in the xcode editor and hit your assigned key
pwnified is offline   Reply With Quote
Old 06-29-2009, 02:44 AM   #8 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 15
Default Use "Lowercase and Uppercase" for all letters in word

Setting the Capitalize Word key will change the first letter of the word to capital. If you want to change all letters in a selection to capitals or lowers, then set a couple of keys for the Uppercase Word and Lowercase Word choices in Text Key Bindings.

i.e., Go into xcode preferences -> KeyBindings ->Text Key Bindings -> Uppercase Word -> assign a key

and

Go into xcode preferences -> KeyBindings ->Text Key Bindings -> Lowercase Word -> assign a different key
rcutshaw is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,224
Threads: 39,002
Posts: 171,077
Top Poster: smasher (2,570)
Welcome to our newest member, SpeJohn613
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:32 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0