Fix memory leaks in Hackbook

Summary:
1) img was alloc'ed and never released while uploading a photo
2) alertview was alloc'ed and never released
3) friendswithapp was alloc'ed twice and never released, updated the logic to use obj c syntax
4) UIGraphicsGetImageFromCurrentImageContext() returns an autoreleased imageView - retaining it is the incorrect solution. See http://stackoverflow.com/questions/1529667/memory-allocation-and-release-for-uiimage-in-iphone

Test Plan:
Run Hackbook in the profiler and verify no memory leaks when loading userpic from the graph api
Upload a photo, verify no longer leaks
View friends with app, verify no longer leaks
Pop the alertview and verify no longer leaks

Reviewers: jacl, caabernathy, mattwkelly, selekman

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D430905

Task ID: 980129
Fix Xcode build path in the static lib build script for Xcode 4.3.1+ or version downloaded from App Store

Summary: Previously xcodebuild could be found under the /Developer directory but it has since moved for Xcode downloaded from the App Store. If the developer has migrated from one version to another, then calling "which xcodebuild" will not work, unless they have run a script called "xcode-select switch". So for now we first check the older location, then look in the newer App Store location.

Test Plan: I tried running the build script in my folder after a recent upgrade from 4.2 to 4.3.1. Without the build script change I got an error. With the build script change, the library was generated.

Reviewers: mmarucheck, bruce, jacl

Reviewed By: jacl

CC: selekman, vijaye, jacl, gregschechte

Differential Revision: https://phabricator.fb.com/D440943

Revert Plan: OK

Task ID: 998703
Rolling up a few pull requests -- thanks!

Summary:
This diff rolls-up the following pull request -
  * 449      - SevaUA
  * 446, 445 - adamvduke
  * 435      - deyton

Test Plan: manual, used hackbook to exercise impacted code

Reviewers: yariv, mmarucheck, vijaye, caabernathy

Reviewed By: vijaye

CC: gregschechte, selekman

Differential Revision: https://phabricator.fb.com/D448786

Task ID: 1021338, 981999
Fixes a recursion bug introduced in the previous diff

Summary:
Reverting the portion of the previous diff that attempted to reuse a reference as a bool,
given that the reference is assigned to late to be used to short-circuit recursion
Fixes string comparison defect

Summary: summary says it all

Test Plan: a little white-box testing with hackbook

Reviewers: mmarucheck, caabernathy, yariv

Reviewed By: mmarucheck

Differential Revision: https://phabricator.fb.com/D457449
Updates the readme to direct developers to the preview bits for the 3.0 SDK.
[ios-sdk] Added method/property declarations.

Summary: Certain versions of Xcode complain about these being missing, others don't. Added them.

Test Plan:
- Built

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: gregschechte

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D531471
HelloFacebook cleanup + PlacesPicker

Summary:
A number of cleanup items for HelloFacebook:

- no longer make the app be a NavigationController based app.  This was needed when the Friend Picker wasn't modal.  Now it is, so there's no point.  Simplifies the AppDelegate impl a bit, and makes a cleaner look.

- Use the new FBRequestConnection static for uploading photos, rather than two step FBRequest construction and then starting.

- Add a "Pick Place" button that invokes the FBPlacePickerViewController.  Motivation here is that it's a major component of our SDK that is very easy to launch and show off in HelloFacebook, consistent with FBFriendPickerViewController, and worth the inclusion.

Test Plan: Both iPhone and iPad on simulator

Reviewers: clang, jacl, ayden, mmarucheck

Reviewed By: jacl

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D532210
[ios-sdk] Added a unit test for REST API calls

Summary:
We were implicitly testing REST calls because token extension uses it, but did not have a unit test
case that explicitly tested it. Since this was useful to me for Android porting, adding it to iOS as well.

Test Plan:
- Ran the unit tests

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: mmarucheck

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D531853
add automatic install attribution

Summary: add publishInstall and invoke it automatically during FBSession init, unless disabled by FBSettings.autoPublishInstall

Test Plan:
using a test app id, set autoPublishInstall to false.  verify that no requests fire on init.
set it to true, and verify that the attribution id hits the server.
run it a third time and verify that the attribution isn't repeated.

Reviewers: jacl, clang, ayden

Reviewed By: ayden

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D526377

Task ID: 1068356
[ios-sdk] Fix one place that used presentingViewController instead of compatiblePresentingViewController.

Summary: presentingViewController is iOS >=5.0 only, so the compatible version must be used for backward compatibility.

Test Plan:
- Ran Scrumptious under 4.3, verified it worked

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: jacl

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D532608

Blame Revision: D525096
Adds il8n support

Summary:
This diff adds resource layout and logic to code to fetch strings for UX
using localization features of iOS. Here are the characteristics -
* If the resource bundle is not present, then it falls back to English, found in the code
* If the resource bundle is present, then it follows standard iOS localization search
  rules, and if nothing is found defaults to the English strings found in the code
* Layout and dimensions are handled via eithat a) by iOS itself, or b) by centering and
  large widths

Test Plan: ran related samples

Reviewers: clang, ayden

Reviewed By: clang

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D534624

Task ID: 1223567
Fixes i18n bug

Summary: Had a duplicate key name, which is now fixed

Test Plan: Run through samples

Reviewers: clang, ayden, gregschechte

Reviewed By: ayden

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D534972

Task ID: 1223567
Removing attribution id reporting code

Summary: Based on new information, we've decided to not include attribution code with the SDK

Test Plan: Build & test

Reviewers: jacl, mmarucheck, clang, jketchpaw

Reviewed By: jacl

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D534745
Change package name to com.facebook.sdk

Summary:
Renamed package name from com.facebook.FBiOSSDK to com.facebook.sdk
Also cleaned up some other instances of FBiOSSDK appearing

Test Plan:
Ran unit tests
Ran samples

Reviewers: jacl, clang

Reviewed By: jacl

CC: msdkexp@, platform-diffs@lists, bhiller

Differential Revision: https://phabricator.fb.com/D532201

Task ID: 1167996
Add social context to the places picker

Summary: Added the category and "# were here" as detail text to the places picker

Test Plan: Ran unit tests, places picker sample

Reviewers: jacl, clang, gregschechte

Reviewed By: jacl

CC: platform-diffs@lists, bhiller, msdkexp@, gregschechte

Differential Revision: https://phabricator.fb.com/D529501

Task ID: 1118327
[ios-sdk] Change FBLoginView and FBUserSettingsViewController to use new UX elements

Summary:
FBLoginView now consists of a single button containing a Facebook icon and "Log In"/"Log Out" text.

FBUserSettingsViewController now has prettier UI. It supports all orientations on iPad but only portrait on iPhone
because our layout is too tall to fit in landscape on a phone without some sort of smart layout approach.

Test Plan:
- Ran HelloFacebook to see FBLoginView
- Ran (not checked in) ViewControllers test app to test FBUserSettingsViewController
- Ran Scrumptious

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: jacl

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D535938

Task ID: 1188684
Merge public master hot fixes

Summary:
Just a merge of the public changes into the private master repo,
in preparation for a push to public master

@merge-commit: jacl

Test Plan: Ran Hackbook and Scrumtious

Reviewers: gregschechte, mmarucheck, clang

Reviewed By: mmarucheck

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D534966

Task ID: 1235919
[ios-sdk] Pickers should update their state when the active session changes.

Summary:
Pickers can track the activeSession but were not disposing of their old state when the active
session changed, meaning they might still contain data that the new session should not have access
to. Fixed both pickers to forget about any data they had, reset their selection, and reset their paging
loaders whenever the active session goes away. They will check in loadData whether they need to update their
notion of session depending on whether they were tracking the activeSession or not.

Test Plan:
- Ran unit tests
- Ran Scrumptious
   - Logged in and out and verified that selection states and displayed data reflected activeSession state
- Ran FriendPickerSample
- Ran PlacePickerSample

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: jacl

CC: msdkexp@, platform-diffs@lists

Differential Revision: https://phabricator.fb.com/D536058

Task ID: 1217636
Finishes localization support with a real local (Hebrew)

Summary:
Adds Hebrew local to prove out localization support, as well as provide
a template for apps that want to localize

Test Plan: Ran relevant samples in both locals

Reviewers: clang, ayden, gregschechte

Reviewed By: clang

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D536587

Task ID: 1223567