├── README
├── Icon.png
├── cache.db
├── Credits.txt
├── Default.png
├── shake.aif
├── preloaded.db
├── Default copy.png
├── Icons
├── Fight.jpg
├── First Aid.jpg
├── Pick-a-Lock.jpg
├── Treat-Shock.jpg
├── Build-a-Fire.jpg
├── CPR & Choking.jpg
├── Change-a-Tire.jpg
├── Purify-Water.jpg
├── Remove-a-Tick.jpg
├── Self Defense.jpg
├── Stop-Bleeding.jpg
├── Take-a-Punch.jpg
├── Treat-a-Burn.jpg
├── All Survival Kit.jpg
├── Animal Attacks.jpg
├── Be-Street-Smart.jpg
├── Build-an-Igloo.jpg
├── Deliver-a-Baby.jpg
├── Do-CPR-on-a-Baby.jpg
├── Home Emergencies.jpg
├── Jump-Start-a-Car.jpg
├── Kick-Down-a-Door.jpg
├── Rescuing Others.jpg
├── Survive-a-Flood.jpg
├── Survive-a-Riot.jpg
├── Treat-Frostbite.jpg
├── Treat-Poisoning.jpg
├── Treat-Road-Rash.jpg
├── Unclog-a-Toilet.jpg
├── Avoid-Being-Mugged.jpg
├── Do-Basic-First-Aid.jpg
├── Do-CPR-on-an-Adult.jpg
├── Escape-a-Minefield.jpg
├── Escape-from-a-Bear.jpg
├── Escapes & Rescues.jpg
├── Extreme Scenarios.jpg
├── Light-a-Road-Flare.jpg
├── Natural Disasters.jpg
├── Stop-a-Nose-Bleed.jpg
├── Survive-a-Riptide.jpg
├── Survive-a-Tsunami.jpg
├── Treat-Hypothermia.jpg
├── Treat-a-Bee-Sting.jpg
├── Treat-a-Concussion.jpg
├── Treat-a-Snake-Bite.jpg
├── Win-a-Street-Fight.jpg
├── Chill-a-Drink-Quickly.jpg
├── Do-a-Fireman's-Carry.jpg
├── Escape-from-Handcuffs.jpg
├── Get-out-of-Quicksand.jpg
├── Handle-a-Dog-Attack.jpg
├── Help-a-Choking-Victim.jpg
├── Household Emergencies.jpg
├── Know-When-Ice-is-Safe.jpg
├── Party "Emergencies".jpg
├── Prepare-for-a-Tornado.jpg
├── Report-an-Emergency.jpg
├── Survive-a-Gas-Attack.jpg
├── Survive-a-Hotel-Fire.jpg
├── Survive-a-Long-Fall.jpg
├── Survive-a-Plane-Crash.jpg
├── Survive-an-Avalanche.jpg
├── Survive-in-the-Woods.jpg
├── Treat-a-Bullet-Wound.jpg
├── Vehicle Emergencies.jpg
├── Wilderness Survival.jpg
├── Attend-to-a-Stab-Wound.jpg
├── Prepare-for-a-Hurricane.jpg
├── Prepare-for-a-Wildfire.jpg
├── Run-Up-and-Over-a-Wall.jpg
├── Stay-Warm-in-Cold-Water.jpg
├── Survive-a-Car-Accident.jpg
├── Survive-a-Shark-Attack.jpg
├── Survive-a-Winter-Storm.jpg
├── Treat-a-Puncture-Wound.jpg
├── Use-a-Fire-Extinguisher.jpg
├── Avoid-a-Rattlesnake-Attack.jpg
├── Deal-With-Party-Crashers.jpg
├── Escape-from-a-Sinking-Car.jpg
├── Fix-a-Dislocated-Shoulder.jpg
├── Make-Water-in-the-Desert.jpg
├── Open-a-Bottle-with-a-Ring.jpg
├── React-During-an-Earthquake.jpg
├── Recognize-a-Heart-Attack.jpg
├── Rescue-an-Avalanche-Victim.jpg
├── Safely-Swim-with-Piranhas.jpg
├── Start-a-Fire-with-Sticks.jpg
├── Stop-a-Car-with-No-Brakes.jpg
├── Survive-a-Fall-Through-Ice.jpg
├── Survive-a-Nuclear-Attack.jpg
├── Survive-in-Federal-Prison.jpg
├── Tell-Time-Without-a-Clock.jpg
├── Fight-off-Multiple-Opponents.jpg
├── Get-Your-Car-Out-of-the-Snow.jpg
├── Protect-a-Baby-from-Drowning.jpg
├── Remove-Red-Wine-from-Fabric.jpg
├── Treat-a-Spinal-Injury-Victim.jpg
├── Avoid-a-Moose-or-Deer-Collision.jpg
├── Clear-a-Building-with-a-Firearm.jpg
├── Do-First-Aid-on-a-Choking-Baby.jpg
├── Escape-From-the-Trunk-of-a-Car.jpg
├── Get-Served-Quickly-at-the-Bar.jpg
├── Keep-Safe-During-a-House-Fire.jpg
├── Open-a-Door-with-a-Credit-Card.jpg
├── Perform-the-Heimlich-Maneuver.jpg
├── Save-an-Active-Drowning-Victim.jpg
├── Stop-an-Engine-from-Overheating.jpg
├── Treat-Poison-Ivy-and-Poison-Oak.jpg
├── Find-True-North-Without-a-Compass.jpg
├── Identify-if-Someone-Had-a-Stroke.jpg
├── Land-an-Airplane-in-an-Emergency.jpg
├── Open-a-Beer-Bottle-with-a-Lighter.jpg
├── Prevent-Household-Appliance-Fires.jpg
├── Regain-Control-of-a-Spooked-Camel.jpg
├── Survive-a-Dust-Storm-or-Sandstorm.jpg
├── Deal-with-Residential-Water-Damage.jpg
├── Help-Someone-Who-Is-Having-a-Seizure.jpg
├── Make-a-Disaster-Plan-for-Your-Family.jpg
├── Make-a-Tight-Turn-Quickly-in-a-Car.jpg
├── Protect-Yourself-in-a-Thunderstorm.jpg
├── Provide-First-Aid-for-a-Broken-Bone.jpg
├── Calculate-the-Distance-from-Lightning.jpg
├── Calculate-the-Distance-to-the-Horizon.jpg
├── Open-a-Beer-Bottle-with-a-Dollar-Bill.jpg
├── Open-a-Wine-Bottle-Without-a-Corkscrew.jpg
├── Predict-the-Weather-Without-a-Forecast.jpg
├── Survive-a-School-or-Workplace-Shooting.jpg
├── Make-the-Pool-Area-Safe-for-Kids-and-Pets.jpg
├── Perform-the-Heimlich-Maneuver-on-Yourself.jpg
├── Rescue-Someone-Who-Has-Fallen-Through-Ice.jpg
├── Survive-an-Abduction-or-Hostage-Situation.jpg
├── Be-Confident-and-Safe-when-Going-Out-Alone.jpg
├── Brake-and-Stop-a-Car-in-the-Shortest-Distance.jpg
├── Get-out-of-a-Car-That's-Hanging-over-a-Cliff.jpg
├── Get-Emergency-Drinking-Water-from-a-Water-Heater.jpg
├── Prepare-Your-Family-for-an-Emergency-Evacuation.jpg
├── Create-an-Urban-Emergency-Evacuation-Kit-for-Work.jpg
├── Survive-an-Encounter-with-a-Crocodile-or-Alligator.jpg
├── Survive-a-Dirty-Bomb-(Radiological-Dispersion-Device).jpg
└── Deal-With-the-Police-when-They-Come-to-Your-Door-at-a-Party.jpg
├── Images
├── About.png
├── Love.png
├── TOS.png
├── Tips.png
├── Category.png
├── Settings.png
├── MissingIcon.png
├── SearchField.png
├── StartButton.png
├── SurvivalKit.png
├── TOSSelected.png
├── wikiHowTitle.png
├── MagnifyingGlass.png
└── ShakeIndicator.png
├── info settings.png
├── info settings 2.png
├── info settings 3.png
├── info settings 4.png
├── Classes
├── Libraries
│ ├── FlurryLib
│ │ ├── libFlurry.a
│ │ └── FlurryAPI.h
│ ├── XML
│ │ ├── TouchXML.h
│ │ ├── CXMLNode_PrivateExtensions.h
│ │ ├── CXMLNode_XPathExtensions.h
│ │ ├── CXMLDocument_PrivateExtensions.h
│ │ ├── CXMLDocument_PrivateExtensions.m
│ │ ├── CXMLElement.h
│ │ ├── CXMLDocument.h
│ │ ├── CXMLNode_PrivateExtensions.m
│ │ ├── CXMLNode_XPathExtensions.m
│ │ ├── CXMLNode.h
│ │ └── CXMLElement.m
│ ├── ImageResize
│ │ ├── UIImage+Resize.h
│ │ └── UIImage+Resize.m
│ ├── HTTPClient
│ │ ├── NSString+HTTPClient.h
│ │ ├── KCHTTPClient.h
│ │ └── NSString+HTTPClient.m
│ ├── NetworkActivityIndicator
│ │ ├── KCNetworkActivityIndicator.h
│ │ └── KCNetworkActivityIndicator.m
│ ├── Debug
│ │ ├── KCLogger.m
│ │ └── KCLogger.h
│ ├── JSON
│ │ ├── JSON.h
│ │ ├── NSString+SBJSON.h
│ │ ├── NSString+SBJSON.m
│ │ ├── NSObject+SBJSON.m
│ │ ├── NSObject+SBJSON.h
│ │ └── SBJSON.h
│ ├── GoogleToolbox
│ │ └── GTMNSString+HTML.h
│ └── SoundEffect
│ │ ├── SoundEffect.h
│ │ └── SoundEffect.m
├── Views
│ ├── WHSearchNetworkAlertView.h
│ ├── WHNetworkAlertView.h
│ ├── WHSearchNetworkAlertView.m
│ ├── WHSearchField.h
│ ├── WHLoadingIndicator.h
│ ├── WHMultiValuePreferenceCell.h
│ ├── WHImageScrollView.h
│ ├── WHTableViewCell.h
│ ├── ABTableViewCell.h
│ ├── WHLoadingIndicator.m
│ ├── WHNetworkAlertView.m
│ ├── WHMultiValuePreferenceCell.m
│ ├── WHImageScrollView.m
│ ├── ABTableViewCell.m
│ ├── WHSearchField.m
│ └── WHTableViewCell.m
├── Helper
│ ├── NSURL+wikiHow.h
│ ├── UITabBarController+DelegatedRotation.h
│ ├── WHSearchXMLReader.h
│ ├── NSString+wikiHow.h
│ ├── UITabBarController+DelegatedRotation.m
│ ├── NSURL+wikiHow.m
│ ├── NSString+wikiHow.m
│ └── WHSearchXMLReader.m
├── ViewControllers
│ ├── WHTipsViewController.h
│ ├── WHAboutViewController.h
│ ├── WHPreferenceViewController.h
│ ├── WHBookmarksViewController.h
│ ├── WHSurvivalKitCategoryViewController.h
│ ├── WHSurvivalKitViewController.h
│ ├── WHFeaturedViewController.h
│ ├── WHNavigationController.h
│ ├── WHImageViewController.h
│ ├── WHSuggestionViewController.h
│ ├── WHArticleViewController.h
│ ├── WHMultiValuePreferenceViewController.h
│ ├── WHSearchViewController.h
│ ├── WHTipsViewController.m
│ ├── WHNavigationController.m
│ └── WHSuggestionViewController.m
├── Models
│ ├── WHBookmark.h
│ ├── WHToggleSwitchPreference.h
│ ├── WHArticle.h
│ ├── WHBookmarksDataSource.h
│ ├── WHBookmark.m
│ ├── WHArticleCache.h
│ ├── WHArticlePreloadedCache.h
│ ├── WHToggleSwitchPreference.m
│ ├── WHArticle.m
│ └── WHBookmarksDataSource.m
└── wikiHowAppDelegate.h
├── wikiHow app 1.5 3-1.moved-aside
└── Entitlements.plist
├── Entitlements.plist
├── wikiHow-app-1.moved-aside
└── Entitlements.plist
├── wikiHow_Prefix.pch
├── Info.plist
├── Constants.h
├── main.m
└── Settings.plist
/README:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icon.png
--------------------------------------------------------------------------------
/cache.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/cache.db
--------------------------------------------------------------------------------
/Credits.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Credits.txt
--------------------------------------------------------------------------------
/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Default.png
--------------------------------------------------------------------------------
/shake.aif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/shake.aif
--------------------------------------------------------------------------------
/preloaded.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/preloaded.db
--------------------------------------------------------------------------------
/Default copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Default copy.png
--------------------------------------------------------------------------------
/Icons/Fight.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Fight.jpg
--------------------------------------------------------------------------------
/Images/About.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/About.png
--------------------------------------------------------------------------------
/Images/Love.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/Love.png
--------------------------------------------------------------------------------
/Images/TOS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/TOS.png
--------------------------------------------------------------------------------
/Images/Tips.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/Tips.png
--------------------------------------------------------------------------------
/info settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/info settings.png
--------------------------------------------------------------------------------
/Icons/First Aid.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/First Aid.jpg
--------------------------------------------------------------------------------
/Icons/Pick-a-Lock.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Pick-a-Lock.jpg
--------------------------------------------------------------------------------
/Icons/Treat-Shock.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-Shock.jpg
--------------------------------------------------------------------------------
/Images/Category.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/Category.png
--------------------------------------------------------------------------------
/Images/Settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/Settings.png
--------------------------------------------------------------------------------
/info settings 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/info settings 2.png
--------------------------------------------------------------------------------
/info settings 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/info settings 3.png
--------------------------------------------------------------------------------
/info settings 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/info settings 4.png
--------------------------------------------------------------------------------
/Icons/Build-a-Fire.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Build-a-Fire.jpg
--------------------------------------------------------------------------------
/Icons/CPR & Choking.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/CPR & Choking.jpg
--------------------------------------------------------------------------------
/Icons/Change-a-Tire.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Change-a-Tire.jpg
--------------------------------------------------------------------------------
/Icons/Purify-Water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Purify-Water.jpg
--------------------------------------------------------------------------------
/Icons/Remove-a-Tick.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Remove-a-Tick.jpg
--------------------------------------------------------------------------------
/Icons/Self Defense.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Self Defense.jpg
--------------------------------------------------------------------------------
/Icons/Stop-Bleeding.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Stop-Bleeding.jpg
--------------------------------------------------------------------------------
/Icons/Take-a-Punch.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Take-a-Punch.jpg
--------------------------------------------------------------------------------
/Icons/Treat-a-Burn.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-a-Burn.jpg
--------------------------------------------------------------------------------
/Images/MissingIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/MissingIcon.png
--------------------------------------------------------------------------------
/Images/SearchField.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/SearchField.png
--------------------------------------------------------------------------------
/Images/StartButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/StartButton.png
--------------------------------------------------------------------------------
/Images/SurvivalKit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/SurvivalKit.png
--------------------------------------------------------------------------------
/Images/TOSSelected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/TOSSelected.png
--------------------------------------------------------------------------------
/Images/wikiHowTitle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/wikiHowTitle.png
--------------------------------------------------------------------------------
/Icons/All Survival Kit.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/All Survival Kit.jpg
--------------------------------------------------------------------------------
/Icons/Animal Attacks.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Animal Attacks.jpg
--------------------------------------------------------------------------------
/Icons/Be-Street-Smart.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Be-Street-Smart.jpg
--------------------------------------------------------------------------------
/Icons/Build-an-Igloo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Build-an-Igloo.jpg
--------------------------------------------------------------------------------
/Icons/Deliver-a-Baby.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Deliver-a-Baby.jpg
--------------------------------------------------------------------------------
/Icons/Do-CPR-on-a-Baby.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Do-CPR-on-a-Baby.jpg
--------------------------------------------------------------------------------
/Icons/Home Emergencies.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Home Emergencies.jpg
--------------------------------------------------------------------------------
/Icons/Jump-Start-a-Car.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Jump-Start-a-Car.jpg
--------------------------------------------------------------------------------
/Icons/Kick-Down-a-Door.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Kick-Down-a-Door.jpg
--------------------------------------------------------------------------------
/Icons/Rescuing Others.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Rescuing Others.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Flood.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Flood.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Riot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Riot.jpg
--------------------------------------------------------------------------------
/Icons/Treat-Frostbite.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-Frostbite.jpg
--------------------------------------------------------------------------------
/Icons/Treat-Poisoning.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-Poisoning.jpg
--------------------------------------------------------------------------------
/Icons/Treat-Road-Rash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-Road-Rash.jpg
--------------------------------------------------------------------------------
/Icons/Unclog-a-Toilet.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Unclog-a-Toilet.jpg
--------------------------------------------------------------------------------
/Images/MagnifyingGlass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/MagnifyingGlass.png
--------------------------------------------------------------------------------
/Images/ShakeIndicator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Images/ShakeIndicator.png
--------------------------------------------------------------------------------
/Icons/Avoid-Being-Mugged.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Avoid-Being-Mugged.jpg
--------------------------------------------------------------------------------
/Icons/Do-Basic-First-Aid.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Do-Basic-First-Aid.jpg
--------------------------------------------------------------------------------
/Icons/Do-CPR-on-an-Adult.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Do-CPR-on-an-Adult.jpg
--------------------------------------------------------------------------------
/Icons/Escape-a-Minefield.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Escape-a-Minefield.jpg
--------------------------------------------------------------------------------
/Icons/Escape-from-a-Bear.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Escape-from-a-Bear.jpg
--------------------------------------------------------------------------------
/Icons/Escapes & Rescues.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Escapes & Rescues.jpg
--------------------------------------------------------------------------------
/Icons/Extreme Scenarios.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Extreme Scenarios.jpg
--------------------------------------------------------------------------------
/Icons/Light-a-Road-Flare.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Light-a-Road-Flare.jpg
--------------------------------------------------------------------------------
/Icons/Natural Disasters.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Natural Disasters.jpg
--------------------------------------------------------------------------------
/Icons/Stop-a-Nose-Bleed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Stop-a-Nose-Bleed.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Riptide.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Riptide.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Tsunami.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Tsunami.jpg
--------------------------------------------------------------------------------
/Icons/Treat-Hypothermia.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-Hypothermia.jpg
--------------------------------------------------------------------------------
/Icons/Treat-a-Bee-Sting.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-a-Bee-Sting.jpg
--------------------------------------------------------------------------------
/Icons/Treat-a-Concussion.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-a-Concussion.jpg
--------------------------------------------------------------------------------
/Icons/Treat-a-Snake-Bite.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-a-Snake-Bite.jpg
--------------------------------------------------------------------------------
/Icons/Win-a-Street-Fight.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Win-a-Street-Fight.jpg
--------------------------------------------------------------------------------
/Icons/Chill-a-Drink-Quickly.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Chill-a-Drink-Quickly.jpg
--------------------------------------------------------------------------------
/Icons/Do-a-Fireman's-Carry.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Do-a-Fireman's-Carry.jpg
--------------------------------------------------------------------------------
/Icons/Escape-from-Handcuffs.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Escape-from-Handcuffs.jpg
--------------------------------------------------------------------------------
/Icons/Get-out-of-Quicksand.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Get-out-of-Quicksand.jpg
--------------------------------------------------------------------------------
/Icons/Handle-a-Dog-Attack.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Handle-a-Dog-Attack.jpg
--------------------------------------------------------------------------------
/Icons/Help-a-Choking-Victim.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Help-a-Choking-Victim.jpg
--------------------------------------------------------------------------------
/Icons/Household Emergencies.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Household Emergencies.jpg
--------------------------------------------------------------------------------
/Icons/Know-When-Ice-is-Safe.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Know-When-Ice-is-Safe.jpg
--------------------------------------------------------------------------------
/Icons/Party "Emergencies".jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Party "Emergencies".jpg
--------------------------------------------------------------------------------
/Icons/Prepare-for-a-Tornado.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Prepare-for-a-Tornado.jpg
--------------------------------------------------------------------------------
/Icons/Report-an-Emergency.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Report-an-Emergency.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Gas-Attack.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Gas-Attack.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Hotel-Fire.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Hotel-Fire.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Long-Fall.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Long-Fall.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Plane-Crash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Plane-Crash.jpg
--------------------------------------------------------------------------------
/Icons/Survive-an-Avalanche.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-an-Avalanche.jpg
--------------------------------------------------------------------------------
/Icons/Survive-in-the-Woods.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-in-the-Woods.jpg
--------------------------------------------------------------------------------
/Icons/Treat-a-Bullet-Wound.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-a-Bullet-Wound.jpg
--------------------------------------------------------------------------------
/Icons/Vehicle Emergencies.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Vehicle Emergencies.jpg
--------------------------------------------------------------------------------
/Icons/Wilderness Survival.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Wilderness Survival.jpg
--------------------------------------------------------------------------------
/Icons/Attend-to-a-Stab-Wound.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Attend-to-a-Stab-Wound.jpg
--------------------------------------------------------------------------------
/Icons/Prepare-for-a-Hurricane.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Prepare-for-a-Hurricane.jpg
--------------------------------------------------------------------------------
/Icons/Prepare-for-a-Wildfire.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Prepare-for-a-Wildfire.jpg
--------------------------------------------------------------------------------
/Icons/Run-Up-and-Over-a-Wall.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Run-Up-and-Over-a-Wall.jpg
--------------------------------------------------------------------------------
/Icons/Stay-Warm-in-Cold-Water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Stay-Warm-in-Cold-Water.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Car-Accident.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Car-Accident.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Shark-Attack.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Shark-Attack.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Winter-Storm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Winter-Storm.jpg
--------------------------------------------------------------------------------
/Icons/Treat-a-Puncture-Wound.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-a-Puncture-Wound.jpg
--------------------------------------------------------------------------------
/Icons/Use-a-Fire-Extinguisher.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Use-a-Fire-Extinguisher.jpg
--------------------------------------------------------------------------------
/Icons/Avoid-a-Rattlesnake-Attack.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Avoid-a-Rattlesnake-Attack.jpg
--------------------------------------------------------------------------------
/Icons/Deal-With-Party-Crashers.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Deal-With-Party-Crashers.jpg
--------------------------------------------------------------------------------
/Icons/Escape-from-a-Sinking-Car.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Escape-from-a-Sinking-Car.jpg
--------------------------------------------------------------------------------
/Icons/Fix-a-Dislocated-Shoulder.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Fix-a-Dislocated-Shoulder.jpg
--------------------------------------------------------------------------------
/Icons/Make-Water-in-the-Desert.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Make-Water-in-the-Desert.jpg
--------------------------------------------------------------------------------
/Icons/Open-a-Bottle-with-a-Ring.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Open-a-Bottle-with-a-Ring.jpg
--------------------------------------------------------------------------------
/Icons/React-During-an-Earthquake.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/React-During-an-Earthquake.jpg
--------------------------------------------------------------------------------
/Icons/Recognize-a-Heart-Attack.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Recognize-a-Heart-Attack.jpg
--------------------------------------------------------------------------------
/Icons/Rescue-an-Avalanche-Victim.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Rescue-an-Avalanche-Victim.jpg
--------------------------------------------------------------------------------
/Icons/Safely-Swim-with-Piranhas.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Safely-Swim-with-Piranhas.jpg
--------------------------------------------------------------------------------
/Icons/Start-a-Fire-with-Sticks.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Start-a-Fire-with-Sticks.jpg
--------------------------------------------------------------------------------
/Icons/Stop-a-Car-with-No-Brakes.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Stop-a-Car-with-No-Brakes.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Fall-Through-Ice.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Fall-Through-Ice.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Nuclear-Attack.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Nuclear-Attack.jpg
--------------------------------------------------------------------------------
/Icons/Survive-in-Federal-Prison.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-in-Federal-Prison.jpg
--------------------------------------------------------------------------------
/Icons/Tell-Time-Without-a-Clock.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Tell-Time-Without-a-Clock.jpg
--------------------------------------------------------------------------------
/Icons/Fight-off-Multiple-Opponents.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Fight-off-Multiple-Opponents.jpg
--------------------------------------------------------------------------------
/Icons/Get-Your-Car-Out-of-the-Snow.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Get-Your-Car-Out-of-the-Snow.jpg
--------------------------------------------------------------------------------
/Icons/Protect-a-Baby-from-Drowning.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Protect-a-Baby-from-Drowning.jpg
--------------------------------------------------------------------------------
/Icons/Remove-Red-Wine-from-Fabric.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Remove-Red-Wine-from-Fabric.jpg
--------------------------------------------------------------------------------
/Icons/Treat-a-Spinal-Injury-Victim.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-a-Spinal-Injury-Victim.jpg
--------------------------------------------------------------------------------
/Classes/Libraries/FlurryLib/libFlurry.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Classes/Libraries/FlurryLib/libFlurry.a
--------------------------------------------------------------------------------
/Icons/Avoid-a-Moose-or-Deer-Collision.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Avoid-a-Moose-or-Deer-Collision.jpg
--------------------------------------------------------------------------------
/Icons/Clear-a-Building-with-a-Firearm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Clear-a-Building-with-a-Firearm.jpg
--------------------------------------------------------------------------------
/Icons/Do-First-Aid-on-a-Choking-Baby.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Do-First-Aid-on-a-Choking-Baby.jpg
--------------------------------------------------------------------------------
/Icons/Escape-From-the-Trunk-of-a-Car.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Escape-From-the-Trunk-of-a-Car.jpg
--------------------------------------------------------------------------------
/Icons/Get-Served-Quickly-at-the-Bar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Get-Served-Quickly-at-the-Bar.jpg
--------------------------------------------------------------------------------
/Icons/Keep-Safe-During-a-House-Fire.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Keep-Safe-During-a-House-Fire.jpg
--------------------------------------------------------------------------------
/Icons/Open-a-Door-with-a-Credit-Card.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Open-a-Door-with-a-Credit-Card.jpg
--------------------------------------------------------------------------------
/Icons/Perform-the-Heimlich-Maneuver.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Perform-the-Heimlich-Maneuver.jpg
--------------------------------------------------------------------------------
/Icons/Save-an-Active-Drowning-Victim.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Save-an-Active-Drowning-Victim.jpg
--------------------------------------------------------------------------------
/Icons/Stop-an-Engine-from-Overheating.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Stop-an-Engine-from-Overheating.jpg
--------------------------------------------------------------------------------
/Icons/Treat-Poison-Ivy-and-Poison-Oak.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Treat-Poison-Ivy-and-Poison-Oak.jpg
--------------------------------------------------------------------------------
/Icons/Find-True-North-Without-a-Compass.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Find-True-North-Without-a-Compass.jpg
--------------------------------------------------------------------------------
/Icons/Identify-if-Someone-Had-a-Stroke.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Identify-if-Someone-Had-a-Stroke.jpg
--------------------------------------------------------------------------------
/Icons/Land-an-Airplane-in-an-Emergency.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Land-an-Airplane-in-an-Emergency.jpg
--------------------------------------------------------------------------------
/Icons/Open-a-Beer-Bottle-with-a-Lighter.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Open-a-Beer-Bottle-with-a-Lighter.jpg
--------------------------------------------------------------------------------
/Icons/Prevent-Household-Appliance-Fires.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Prevent-Household-Appliance-Fires.jpg
--------------------------------------------------------------------------------
/Icons/Regain-Control-of-a-Spooked-Camel.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Regain-Control-of-a-Spooked-Camel.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Dust-Storm-or-Sandstorm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Dust-Storm-or-Sandstorm.jpg
--------------------------------------------------------------------------------
/Icons/Deal-with-Residential-Water-Damage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Deal-with-Residential-Water-Damage.jpg
--------------------------------------------------------------------------------
/Icons/Help-Someone-Who-Is-Having-a-Seizure.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Help-Someone-Who-Is-Having-a-Seizure.jpg
--------------------------------------------------------------------------------
/Icons/Make-a-Disaster-Plan-for-Your-Family.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Make-a-Disaster-Plan-for-Your-Family.jpg
--------------------------------------------------------------------------------
/Icons/Make-a-Tight-Turn-Quickly-in-a-Car.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Make-a-Tight-Turn-Quickly-in-a-Car.jpg
--------------------------------------------------------------------------------
/Icons/Protect-Yourself-in-a-Thunderstorm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Protect-Yourself-in-a-Thunderstorm.jpg
--------------------------------------------------------------------------------
/Icons/Provide-First-Aid-for-a-Broken-Bone.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Provide-First-Aid-for-a-Broken-Bone.jpg
--------------------------------------------------------------------------------
/Icons/Calculate-the-Distance-from-Lightning.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Calculate-the-Distance-from-Lightning.jpg
--------------------------------------------------------------------------------
/Icons/Calculate-the-Distance-to-the-Horizon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Calculate-the-Distance-to-the-Horizon.jpg
--------------------------------------------------------------------------------
/Icons/Open-a-Beer-Bottle-with-a-Dollar-Bill.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Open-a-Beer-Bottle-with-a-Dollar-Bill.jpg
--------------------------------------------------------------------------------
/Icons/Open-a-Wine-Bottle-Without-a-Corkscrew.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Open-a-Wine-Bottle-Without-a-Corkscrew.jpg
--------------------------------------------------------------------------------
/Icons/Predict-the-Weather-Without-a-Forecast.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Predict-the-Weather-Without-a-Forecast.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-School-or-Workplace-Shooting.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-School-or-Workplace-Shooting.jpg
--------------------------------------------------------------------------------
/Icons/Make-the-Pool-Area-Safe-for-Kids-and-Pets.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Make-the-Pool-Area-Safe-for-Kids-and-Pets.jpg
--------------------------------------------------------------------------------
/Icons/Perform-the-Heimlich-Maneuver-on-Yourself.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Perform-the-Heimlich-Maneuver-on-Yourself.jpg
--------------------------------------------------------------------------------
/Icons/Rescue-Someone-Who-Has-Fallen-Through-Ice.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Rescue-Someone-Who-Has-Fallen-Through-Ice.jpg
--------------------------------------------------------------------------------
/Icons/Survive-an-Abduction-or-Hostage-Situation.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-an-Abduction-or-Hostage-Situation.jpg
--------------------------------------------------------------------------------
/Icons/Be-Confident-and-Safe-when-Going-Out-Alone.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Be-Confident-and-Safe-when-Going-Out-Alone.jpg
--------------------------------------------------------------------------------
/Icons/Brake-and-Stop-a-Car-in-the-Shortest-Distance.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Brake-and-Stop-a-Car-in-the-Shortest-Distance.jpg
--------------------------------------------------------------------------------
/Icons/Get-out-of-a-Car-That's-Hanging-over-a-Cliff.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Get-out-of-a-Car-That's-Hanging-over-a-Cliff.jpg
--------------------------------------------------------------------------------
/Icons/Get-Emergency-Drinking-Water-from-a-Water-Heater.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Get-Emergency-Drinking-Water-from-a-Water-Heater.jpg
--------------------------------------------------------------------------------
/Icons/Prepare-Your-Family-for-an-Emergency-Evacuation.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Prepare-Your-Family-for-an-Emergency-Evacuation.jpg
--------------------------------------------------------------------------------
/Icons/Create-an-Urban-Emergency-Evacuation-Kit-for-Work.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Create-an-Urban-Emergency-Evacuation-Kit-for-Work.jpg
--------------------------------------------------------------------------------
/Icons/Survive-an-Encounter-with-a-Crocodile-or-Alligator.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-an-Encounter-with-a-Crocodile-or-Alligator.jpg
--------------------------------------------------------------------------------
/Icons/Survive-a-Dirty-Bomb-(Radiological-Dispersion-Device).jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Survive-a-Dirty-Bomb-(Radiological-Dispersion-Device).jpg
--------------------------------------------------------------------------------
/Icons/Deal-With-the-Police-when-They-Come-to-Your-Door-at-a-Party.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tderouin/wikiHow-iPhone-Application/HEAD/Icons/Deal-With-the-Police-when-They-Come-to-Your-Door-at-a-Party.jpg
--------------------------------------------------------------------------------
/wikiHow app 1.5 3-1.moved-aside/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | get-task-allow
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/wikiHow-app-1.moved-aside/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | get-task-allow
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/TouchXML.h:
--------------------------------------------------------------------------------
1 | //
2 | // TouchXML.h
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 07/11/08.
6 | // Copyright 2008 Toxic Software. All rights reserved.
7 | //
8 |
9 | #import "CXMLDocument.h"
10 | #import "CXMLElement.h"
11 | #import "CXMLNode.h"
12 | #import "CXMLNode_XPathExtensions.h"
--------------------------------------------------------------------------------
/wikiHow_Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'wikiHow' target in the 'wikiHow' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #import
8 | #import "Constants.h"
9 | #import "wikiHowAppDelegate.h"
10 | #import "KCLogger.h"
11 | #endif
12 |
--------------------------------------------------------------------------------
/Classes/Views/WHSearchNetworkAlertView.h:
--------------------------------------------------------------------------------
1 | //
2 | // WHSearchNetworkAlertView.h
3 | // wikiHow
4 | //
5 | // Created by Keishi Hattori on 4/8/09.
6 | // Copyright 2009 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "WHNetworkAlertView.h"
11 |
12 |
13 | @interface WHSearchNetworkAlertView : WHNetworkAlertView {
14 |
15 | }
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Classes/Views/WHNetworkAlertView.h:
--------------------------------------------------------------------------------
1 | //
2 | // WHNetworkAlertView.h
3 | // wikiHow
4 | //
5 | // Created by Keishi Hattori on 4/8/09.
6 | // Copyright 2009 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface WHNetworkAlertView : UIAlertView {
13 | BOOL noConnectionAlert;
14 | }
15 |
16 | - (id)initWithError:(NSError *)error;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/CXMLNode_PrivateExtensions.h:
--------------------------------------------------------------------------------
1 | //
2 | // CXMLNode_PrivateExtensions.h
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 03/07/08.
6 | // Copyright 2008 Toxic Software. All rights reserved.
7 | //
8 |
9 | #import "CXMLNode.h"
10 |
11 | @interface CXMLNode (CXMLNode_PrivateExtensions)
12 |
13 | - (id)initWithLibXMLNode:(xmlNodePtr)inLibXMLNode;
14 |
15 | + (id)nodeWithLibXMLNode:(xmlNodePtr)inLibXMLNode;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/CXMLNode_XPathExtensions.h:
--------------------------------------------------------------------------------
1 | //
2 | // CXMLNode_XPathExtensions.h
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 04/01/08.
6 | // Copyright 2008 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import "CXMLNode.h"
10 |
11 | @interface CXMLNode (CXMLNode_XPathExtensions)
12 |
13 | - (NSArray *)nodesForXPath:(NSString *)xpath namespaceMappings:(NSDictionary *)inNamespaceMappings error:(NSError **)error;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/CXMLDocument_PrivateExtensions.h:
--------------------------------------------------------------------------------
1 | //
2 | // CXMLDocument_PrivateExtensions.h
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 03/07/08.
6 | // Copyright 2008 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import "CXMLDocument.h"
10 |
11 | #include
12 |
13 | @interface CXMLDocument (CXMLDocument_PrivateExtensions)
14 |
15 | //- (id)initWithLibXmlParserContext:(xmlParserCtxtPtr)inContext options:(NSUInteger)inOptions error:(NSError **)outError;
16 |
17 | - (NSMutableSet *)nodePool;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/CXMLDocument_PrivateExtensions.m:
--------------------------------------------------------------------------------
1 | //
2 | // CXMLDocument_PrivateExtensions.m
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 03/07/08.
6 | // Copyright 2008 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import "CXMLDocument_PrivateExtensions.h"
10 |
11 | @implementation CXMLDocument (CXMLDocument_PrivateExtensions)
12 |
13 | /*
14 | - (id)initWithLibXmlParserContext:(xmlParserCtxtPtr)inContext options:(NSUInteger)inOptions error:(NSError **)outError
15 | {
16 |
17 | xmlParseDocument(inContext);
18 |
19 | }
20 | */
21 |
22 | - (NSMutableSet *)nodePool
23 | {
24 | if (nodePool == NULL)
25 | {
26 | nodePool = [[NSMutableSet alloc] init];
27 | }
28 | return(nodePool);
29 | }
30 |
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/CXMLElement.h:
--------------------------------------------------------------------------------
1 | //
2 | // CXMLElement.h
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 03/07/08.
6 | // Copyright 2008 Toxic Software. All rights reserved.
7 | //
8 |
9 | #import "CXMLNode.h"
10 |
11 | // NSXMLElement
12 | @interface CXMLElement : CXMLNode {
13 |
14 | }
15 |
16 | - (NSArray *)elementsForName:(NSString *)name;
17 | //- (NSArray *)elementsForLocalName:(NSString *)localName URI:(NSString *)URI;
18 |
19 | - (NSArray *)attributes;
20 | - (CXMLNode *)attributeForName:(NSString *)name;
21 | //- (CXMLNode *)attributeForLocalName:(NSString *)localName URI:(NSString *)URI;
22 |
23 | //- (NSArray *)namespaces; //primitive
24 | //- (CXMLNode *)namespaceForPrefix:(NSString *)name;
25 | //- (CXMLNode *)resolveNamespaceForName:(NSString *)name;
26 | //- (NSString *)resolvePrefixForNamespaceURI:(NSString *)namespaceURI;
27 |
28 | - (NSString*)_XMLStringWithOptions:(NSUInteger)options appendingToString:(NSMutableString*)str;
29 | @end
30 |
--------------------------------------------------------------------------------
/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIconFile
12 |
13 | CFBundleIdentifier
14 | com.wikihow.wikiHowApp
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleName
18 | ${PRODUCT_NAME}
19 | CFBundlePackageType
20 | APPL
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.5
25 | CFBundleGetInfoString
26 | Survival Kit
27 | LSRequiresIPhoneOS
28 |
29 | NSMainNibFile
30 | MainWindowSK
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Classes/Views/WHSearchNetworkAlertView.m:
--------------------------------------------------------------------------------
1 | //
2 | // WHSearchNetworkAlertView.m
3 | // wikiHow
4 | //
5 | // Created by Keishi Hattori on 4/8/09.
6 | // Copyright 2009 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import "WHSearchNetworkAlertView.h"
10 |
11 |
12 | @implementation WHSearchNetworkAlertView
13 |
14 |
15 | - (id)initWithError:(NSError *)error {
16 | [UIAppDelegate lockShake];
17 | if ([error code] == -1009) {
18 | [self initWithTitle:@"You are not connected to the Internet." message:@"You are not connected to the internet and offline search is disabled. Offline search enables you to search articles stored in the Survival Kit and your bookmarks. To search, either connect to the internet or turn offline search on in settings." delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", @"Settings", nil];
19 | noConnectionAlert = YES;
20 | } else {
21 | [self initWithTitle:@"Network Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
22 | noConnectionAlert = NO;
23 | }
24 | return self;
25 | }
26 |
27 | - (void)_selectTabForButtonIndex:(NSInteger)buttonIndex {
28 | if (buttonIndex == 1) {
29 | UIAppDelegate.tabBarController.selectedIndex = 4;
30 | }
31 | }
32 |
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Classes/Views/WHSearchField.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHSearchField : UITextField {
28 | }
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/Classes/Views/WHLoadingIndicator.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHLoadingIndicator : UIView {
28 |
29 | }
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/Constants.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #define CHECK_FOR_NOSUCHACTION YES
25 | #define ENABLE_STATELESS_TABS YES
26 | #define FLURRY_API_KEY @"XXXXXXXXXXXXXXXXXXXX"
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Classes/Helper/NSURL+wikiHow.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface NSURL (wikiHow)
28 |
29 | - (BOOL)isWikiHowArticleURL;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHTipsViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHTipsViewController : UIViewController {
28 | }
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHAboutViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHAboutViewController : UITableViewController {
28 |
29 | }
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/Classes/Helper/UITabBarController+DelegatedRotation.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface UITabBarController (DelegatedRotation)
28 |
29 |
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/Classes/Libraries/ImageResize/UIImage+Resize.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface UIImage (Resize)
28 |
29 | - (UIImage*)imageScaledToSize:(CGSize)newSize;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHPreferenceViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHPreferenceViewController : UITableViewController {
28 | NSMutableArray *preferences;
29 | }
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHBookmarksViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHBookmarksViewController : UITableViewController {
28 | NSDate *lastReload;
29 | UILabel *noBookmarksLabel;
30 | }
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHSurvivalKitCategoryViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHSurvivalKitCategoryViewController : UITableViewController {
28 | NSArray *indexNames;
29 | NSArray *indexes;
30 | }
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/CXMLDocument.h:
--------------------------------------------------------------------------------
1 | //
2 | // CXMLDocument.h
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 03/07/08.
6 | // Copyright 2008 Toxic Software. All rights reserved.
7 | //
8 |
9 | #import "CXMLNode.h"
10 |
11 | enum {
12 | CXMLDocumentTidyHTML = 1 << 9
13 | };
14 |
15 | @class CXMLElement;
16 |
17 | @interface CXMLDocument : CXMLNode {
18 | NSMutableSet *nodePool;
19 | }
20 |
21 | - (id)initWithXMLString:(NSString *)inString options:(NSUInteger)inOptions error:(NSError **)outError;
22 | - (id)initWithContentsOfURL:(NSURL *)inURL options:(NSUInteger)inOptions error:(NSError **)outError;
23 | - (id)initWithData:(NSData *)inData options:(NSUInteger)inOptions error:(NSError **)outError;
24 |
25 | //- (NSString *)characterEncoding;
26 | //- (NSString *)version;
27 | //- (BOOL)isStandalone;
28 | //- (CXMLDocumentContentKind)documentContentKind;
29 | //- (NSString *)MIMEType;
30 | //- (CXMLDTD *)DTD;
31 |
32 | - (CXMLElement *)rootElement;
33 |
34 | //- (NSData *)XMLData;
35 | //- (NSData *)XMLDataWithOptions:(NSUInteger)options;
36 |
37 | //- (id)objectByApplyingXSLT:(NSData *)xslt arguments:(NSDictionary *)arguments error:(NSError **)error;
38 | //- (id)objectByApplyingXSLTString:(NSString *)xslt arguments:(NSDictionary *)arguments error:(NSError **)error;
39 | //- (id)objectByApplyingXSLTAtURL:(NSURL *)xsltURL arguments:(NSDictionary *)argument error:(NSError **)error;
40 |
41 | //- (id)XMLStringWithOptions:(NSUInteger)options;
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/Classes/Views/WHMultiValuePreferenceCell.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHMultiValuePreferenceCell : UITableViewCell {
28 | UILabel *valueLabel;
29 | }
30 |
31 | @property (nonatomic, retain) UILabel *valueLabel;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHSurvivalKitViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHSurvivalKitViewController : UITableViewController {
28 | NSArray *indexNames;
29 | NSArray *indexes;
30 | NSString *category;
31 | }
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/main.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 | int main(int argc, char *argv[]) {
27 |
28 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
29 | int retVal = UIApplicationMain(argc, argv, nil, nil);
30 | [pool release];
31 | return retVal;
32 | }
33 |
--------------------------------------------------------------------------------
/Classes/Views/WHImageScrollView.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHImageScrollView : UIScrollView {
28 | UIImageView *imageView;
29 | }
30 |
31 | // Only call this method once per instance.
32 | - (void)setImage:(UIImage *)image;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Classes/Models/WHBookmark.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHBookmark : NSObject {
28 | NSString *identifier;
29 | NSString *title;
30 | }
31 |
32 | @property (nonatomic, copy) NSString *identifier;
33 | @property (nonatomic, copy) NSString *title;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHFeaturedViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 | #import "KCHTTPClient.h"
26 |
27 |
28 | @interface WHFeaturedViewController : UITableViewController {
29 | NSMutableArray *featuredArticles;
30 | KCHTTPClient *HTTPClient;
31 | }
32 |
33 | - (void)loadFeatured;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Classes/Libraries/HTTPClient/NSString+HTTPClient.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface NSString (HTTPClient)
28 |
29 | - (NSString *)stringEscapedAsURI;
30 | - (NSString *)stringEscapedAsURIComponent;
31 | - (NSString *)stringUnescapedAsURI;
32 | - (NSString *)stringUnescapedAsURIComponent;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHNavigationController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHNavigationController : UINavigationController {
28 |
29 | }
30 |
31 | - (void)pushViewControllerWithIdentifier:(NSString *)identifier animated:(BOOL)animated;
32 | - (NSMutableArray *)navigationLocation;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Classes/Helper/WHSearchXMLReader.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHSearchXMLReader : NSObject {
28 | NSMutableArray *_result;
29 | NSMutableString *_contentOfElement;
30 | NSMutableDictionary *_article;
31 | }
32 |
33 | - (NSArray *)parseXMLData:(NSData *)XMLData parseError:(NSError **)error;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Classes/Helper/NSString+wikiHow.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface NSString (wikiHow)
28 |
29 | - (NSString *)stringEscapedWikiHowStyle;
30 | - (NSString *)stringUnescapedWikiHowStyle;
31 | - (NSString *)identifierTitle;
32 | - (NSString *)identifierNamespace;
33 | - (NSString *)normalizedJSONString;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Classes/Libraries/NetworkActivityIndicator/KCNetworkActivityIndicator.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 | @interface KCNetworkActivityIndicator : NSObject {
27 | NSUInteger count;
28 | }
29 |
30 | @property (nonatomic, readonly) NSUInteger count;
31 |
32 | + (KCNetworkActivityIndicator *)sharedIndicator;
33 | - (void)start;
34 | - (void)stop;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHImageViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 | #import "WHImageScrollView.h"
26 |
27 |
28 | @interface WHImageViewController : UIViewController {
29 | NSString *identifier;
30 | WHImageScrollView *scrollView;
31 | UIProgressView *progressView;
32 | NSInteger maxRetry;
33 | }
34 |
35 | @property (nonatomic, readonly) NSString *identifier;
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/CXMLNode_PrivateExtensions.m:
--------------------------------------------------------------------------------
1 | //
2 | // CXMLNode_PrivateExtensions.m
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 03/07/08.
6 | // Copyright 2008 Toxic Software. All rights reserved.
7 | //
8 |
9 | #import "CXMLNode_PrivateExtensions.h"
10 |
11 | #import "CXMLElement.h"
12 | #import "CXMLDocument_PrivateExtensions.h"
13 |
14 | @implementation CXMLNode (CXMLNode_PrivateExtensions)
15 |
16 | - (id)initWithLibXMLNode:(xmlNodePtr)inLibXMLNode;
17 | {
18 | if ((self = [super init]) != NULL)
19 | {
20 | _node = inLibXMLNode;
21 | }
22 | return(self);
23 | }
24 |
25 | + (id)nodeWithLibXMLNode:(xmlNodePtr)inLibXMLNode
26 | {
27 | // TODO more checking.
28 | if (inLibXMLNode->_private)
29 | return(inLibXMLNode->_private);
30 |
31 | Class theClass = [CXMLNode class];
32 | switch (inLibXMLNode->type)
33 | {
34 | case XML_ELEMENT_NODE:
35 | theClass = [CXMLElement class];
36 | break;
37 | case XML_ATTRIBUTE_NODE:
38 | case XML_TEXT_NODE:
39 | case XML_CDATA_SECTION_NODE:
40 | case XML_COMMENT_NODE:
41 | break;
42 | default:
43 | NSAssert1(NO, @"TODO Unhandled type (%d).", inLibXMLNode->type);
44 | return(NULL);
45 | }
46 |
47 | CXMLNode *theNode = [[[theClass alloc] initWithLibXMLNode:inLibXMLNode] autorelease];
48 |
49 |
50 | CXMLDocument *theXMLDocument = inLibXMLNode->doc->_private;
51 | NSAssert(theXMLDocument != NULL, @"TODO");
52 | NSAssert([theXMLDocument isKindOfClass:[CXMLDocument class]] == YES, @"TODO");
53 |
54 | [[theXMLDocument nodePool] addObject:theNode];
55 |
56 | theNode->_node->_private = theNode;
57 | return(theNode);
58 | }
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHSuggestionViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHSuggestionViewController : UITableViewController {
28 | NSMutableArray *history;
29 | NSMutableArray *result;
30 | id delegate;
31 | }
32 |
33 | @property (nonatomic, assign) id delegate;
34 |
35 | - (void)add:(NSString *)s;
36 | - (void)suggestWithQuery:(NSString *)q;
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Classes/Libraries/ImageResize/UIImage+Resize.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "UIImage+Resize.h"
25 |
26 |
27 | @implementation UIImage (Resize)
28 |
29 | - (UIImage*)imageScaledToSize:(CGSize)newSize {
30 | UIGraphicsBeginImageContext(newSize);
31 | [self drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
32 | UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
33 | UIGraphicsEndImageContext();
34 | return newImage;
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/Classes/Views/WHTableViewCell.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 | #import "ABTableViewCell.h"
26 |
27 |
28 | @interface WHTableViewCell : ABTableViewCell {
29 | UIImage *icon;
30 | NSString *title;
31 | BOOL isUsingIndex;
32 | float leftIndentation;
33 | }
34 |
35 | @property (nonatomic, retain) UIImage *icon;
36 | @property (nonatomic, copy) NSString *title;
37 | @property (nonatomic, assign) BOOL isUsingIndex;
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/Classes/Helper/UITabBarController+DelegatedRotation.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "UITabBarController+DelegatedRotation.h"
25 |
26 |
27 | @implementation UITabBarController (DelegatedRotation)
28 |
29 | #pragma mark Handling Rotation
30 |
31 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
32 | return [[self selectedViewController] shouldAutorotateToInterfaceOrientation:interfaceOrientation];
33 | }
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Classes/Views/ABTableViewCell.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Loren Brichter
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // ABTableViewCell.h
25 | //
26 | // Created by Loren Brichter
27 | // Copyright 2008 Loren Brichter. All rights reserved.
28 | //
29 |
30 | #import
31 |
32 | // to use: subclass ABTableViewCell and implement -drawContentView:
33 |
34 | @interface ABTableViewCell : UITableViewCell
35 | {
36 | UIView *contentView;
37 | }
38 |
39 | - (void)drawContentView:(CGRect)r; // subclasses should implement
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/Classes/Views/WHLoadingIndicator.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHLoadingIndicator.h"
25 |
26 |
27 | @implementation WHLoadingIndicator
28 |
29 |
30 | - (id)initWithFrame:(CGRect)frame {
31 | if (self = [super initWithFrame:frame]) {
32 | // Initialization code
33 | }
34 | return self;
35 | }
36 |
37 |
38 | - (void)drawRect:(CGRect)rect {
39 | // Drawing code
40 | }
41 |
42 |
43 | - (void)dealloc {
44 | [super dealloc];
45 | }
46 |
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Classes/Models/WHToggleSwitchPreference.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHToggleSwitchPreference : NSObject {
28 | UITableViewCell *cell;
29 | NSString *key;
30 | UISwitch *toggleSwitch;
31 | }
32 |
33 | @property (nonatomic, readonly) UITableViewCell *cell;
34 | @property (nonatomic, readonly) NSString *key;
35 | @property (nonatomic, readonly) UISwitch *toggleSwitch;
36 |
37 | - (id)initWithSpecifier:(NSDictionary *)specifier;
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/Classes/Models/WHArticle.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface WHArticle : NSObject {
28 | NSString *identifier;
29 | NSString *title;
30 | NSString *HTML;
31 | NSString *category;
32 | BOOL isCached;
33 | }
34 |
35 | @property (nonatomic, copy) NSString *identifier;
36 | @property (nonatomic, copy) NSString *title;
37 | @property (nonatomic, copy) NSString *HTML;
38 | @property (nonatomic, copy) NSString *category;
39 | @property (nonatomic, assign) BOOL isCached;
40 |
41 | + (NSString *)titleWithIdentifier:(NSString *)anIdentifier;
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/Classes/Models/WHBookmarksDataSource.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 | #import "WHArticle.h"
26 |
27 |
28 | @interface WHBookmarksDataSource : NSObject {
29 | NSMutableArray *bookmarks;
30 | NSDate *lastModified;
31 | NSDate *lastSaved;
32 | }
33 |
34 | @property (nonatomic, readonly) NSMutableArray *bookmarks;
35 | @property (nonatomic, retain) NSDate *lastModified;
36 |
37 | + (WHBookmarksDataSource *)sharedDataSource;
38 | - (void)save;
39 | - (void)bookmarkArticle:(WHArticle *)article;
40 | - (void)updateLastModified;
41 | - (BOOL)isBookmarked:(NSString *)identifier;
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/Classes/Libraries/Debug/KCLogger.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "KCLogger.h"
25 |
26 |
27 | @implementation KCLogger
28 |
29 | + (void)logFile:(char*)sourceFile lineNumber:(int)lineNumber format:(NSString*)format, ... {
30 | va_list ap;
31 | NSString *print;
32 | NSString *file;
33 | va_start(ap,format);
34 | file = [[NSString alloc] initWithBytes:sourceFile length:strlen(sourceFile) encoding:NSUTF8StringEncoding];
35 | print = [[NSString alloc] initWithFormat:format arguments:ap];
36 | va_end(ap);
37 | NSLog(@"%s:%d %@", [[file lastPathComponent] UTF8String], lineNumber, print);
38 | [print release];
39 | [file release];
40 | }
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHArticleViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 | #import "WHArticle.h"
26 | #import "KCHTTPClient.h"
27 |
28 |
29 | @interface WHArticleViewController : UIViewController {
30 | UIWebView *webView;
31 | UIActivityIndicatorView *loadingIndicatorView;
32 | WHArticle *article;
33 | BOOL HTMLNotSetFlag;
34 | KCHTTPClient *HTTPClient;
35 | }
36 |
37 | @property (nonatomic, readonly) WHArticle *article;
38 |
39 | - (id)initWithIdentifier:(NSString *)identifier;
40 | - (void)showArticle;
41 | - (void)setHTML;
42 | - (void)webViewTimeout;
43 | - (void)changeHash:(NSString *)fragment;
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHMultiValuePreferenceViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 | #import "WHMultiValuePreferenceCell.h"
26 |
27 |
28 | @interface WHMultiValuePreferenceViewController : UITableViewController {
29 | WHMultiValuePreferenceCell *cell;
30 | NSArray *titles;
31 | NSArray *values;
32 | NSString *key;
33 | NSInteger selectedIndex;
34 | }
35 |
36 | @property (nonatomic, readonly) WHMultiValuePreferenceCell *cell;
37 | @property (nonatomic, readonly) NSArray *titles;
38 | @property (nonatomic, readonly) NSArray *values;
39 | @property (nonatomic, readonly) NSString *key;
40 | @property (nonatomic, assign) NSInteger selectedIndex;
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/Classes/Models/WHBookmark.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHBookmark.h"
25 |
26 |
27 | @implementation WHBookmark
28 |
29 | @synthesize identifier;
30 | @synthesize title;
31 |
32 | - (id)initWithCoder:(NSCoder *)coder {
33 | self = [super init];
34 | identifier = [[coder decodeObjectForKey:@"identifier"] retain];
35 | title = [[coder decodeObjectForKey:@"title"] retain];
36 | return self;
37 | }
38 |
39 | - (void)encodeWithCoder:(NSCoder *)coder {
40 | [coder encodeObject:identifier forKey:@"identifier"];
41 | [coder encodeObject:title forKey:@"title"];
42 | }
43 |
44 | - (void)dealloc {
45 | [identifier release];
46 | [title release];
47 | [super dealloc];
48 | }
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/CXMLNode_XPathExtensions.m:
--------------------------------------------------------------------------------
1 | //
2 | // CXMLNode_XPathExtensions.m
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 04/01/08.
6 | // Copyright 2008 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import "CXMLNode_XPathExtensions.h"
10 |
11 | #import "CXMLDocument.h"
12 | #import "CXMLNode_PrivateExtensions.h"
13 |
14 | #include
15 | #include
16 |
17 | @implementation CXMLNode (CXMLNode_NamespaceExtensions)
18 |
19 | - (NSArray *)nodesForXPath:(NSString *)xpath namespaceMappings:(NSDictionary *)inNamespaceMappings error:(NSError **)error;
20 | {
21 | NSAssert(_node != NULL, @"TODO");
22 |
23 | NSArray *theResult = NULL;
24 |
25 | CXMLNode *theRootDocument = [self rootDocument];
26 | xmlXPathContextPtr theXPathContext = xmlXPathNewContext((xmlDocPtr)theRootDocument->_node);
27 | theXPathContext->node = _node;
28 |
29 | for (NSString *thePrefix in inNamespaceMappings)
30 | {
31 | xmlXPathRegisterNs(theXPathContext, (xmlChar *)[thePrefix UTF8String], (xmlChar *)[[inNamespaceMappings objectForKey:thePrefix] UTF8String]);
32 | }
33 |
34 | // TODO considering putting xmlChar <-> UTF8 into a NSString category
35 | xmlXPathObjectPtr theXPathObject = xmlXPathEvalExpression((const xmlChar *)[xpath UTF8String], theXPathContext);
36 | if (xmlXPathNodeSetIsEmpty(theXPathObject->nodesetval))
37 | theResult = [NSArray array]; // TODO better to return NULL?
38 | else
39 | {
40 | NSMutableArray *theArray = [NSMutableArray array];
41 | int N;
42 | for (N = 0; N < theXPathObject->nodesetval->nodeNr; N++)
43 | {
44 | xmlNodePtr theNode = theXPathObject->nodesetval->nodeTab[N];
45 | [theArray addObject:[CXMLNode nodeWithLibXMLNode:theNode]];
46 | }
47 |
48 | theResult = theArray;
49 | }
50 |
51 | xmlXPathFreeObject(theXPathObject);
52 |
53 | xmlXPathFreeContext(theXPathContext);
54 | return(theResult);
55 | }
56 |
57 | @end
58 |
--------------------------------------------------------------------------------
/Classes/Helper/NSURL+wikiHow.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "NSURL+wikiHow.h"
25 |
26 |
27 | @implementation NSURL (wikiHow)
28 |
29 | - (BOOL)isWikiHowArticleURL {
30 | NSString *path = [self path];
31 | return [[self host] isEqualToString:@"www.wikihow.com"] &&
32 | ![path hasPrefix:@"index.php"] &&
33 | ![path hasPrefix:@"Category:"] &&
34 | ![path hasPrefix:@"Image:"] &&
35 | ![path hasPrefix:@"wikiHow:"] &&
36 | ![path hasPrefix:@"Category:"] &&
37 | ![path hasPrefix:@"wikiHow_talk:"] &&
38 | ![path hasPrefix:@"User:"] &&
39 | ![path hasPrefix:@"Special:"];
40 | }
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHSearchViewController.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 | #import "WHSearchField.h"
26 | #import "KCHTTPClient.h"
27 | #import "WHSuggestionViewController.h"
28 |
29 |
30 | @interface WHSearchViewController : UIViewController {
31 | NSArray *results;
32 | WHSearchField *searchField;
33 | UIButton *shadeButton;
34 | UITableView *tableView;
35 | WHSuggestionViewController *suggestionViewController;
36 | KCHTTPClient *HTTPClient;
37 | UIImageView *shakeIndicatorView;
38 | UILabel *noMatchesLabel;
39 | }
40 |
41 | @property (nonatomic, readonly) UITableView *tableView;
42 |
43 | - (void)updateResults;
44 | - (void)setSearchFieldText:(NSString *)q;
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Settings.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Title
6 | Settings
7 | PreferenceSpecifiers
8 |
9 |
10 | Title
11 | Font Size
12 | Type
13 | PSMultiValueSpecifier
14 | Key
15 | FontSize
16 | Titles
17 |
18 | Small
19 | Medium
20 | Big
21 |
22 | Values
23 |
24 | fontSmall
25 | fontMedium
26 | fontBig
27 |
28 | DefaultValue
29 | fontSmall
30 |
31 |
32 | Key
33 | CacheLife
34 | Title
35 | Delete Cache After
36 | Type
37 | PSMultiValueSpecifier
38 | DefaultValue
39 | 0
40 | Titles
41 |
42 | 7 days
43 | 14 days
44 | Never
45 |
46 | Values
47 |
48 | 7
49 | 14
50 | 0
51 |
52 |
53 |
54 | Key
55 | EnableShake
56 | Title
57 | Enable Shake
58 | Type
59 | PSToggleSwitchSpecifier
60 | DefaultValue
61 |
62 |
63 |
64 | Key
65 | OfflineSearch
66 | Title
67 | Offline Search
68 | Type
69 | PSToggleSwitchSpecifier
70 | DefaultValue
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/Classes/Models/WHArticleCache.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 | #import "sqlite3.h"
26 | #import "WHArticle.h"
27 |
28 | @interface WHArticleCache : NSObject {
29 | sqlite3 *database;
30 | sqlite3_stmt *load_statement;
31 | sqlite3_stmt *insert_statement;
32 | sqlite3_stmt *search_statement;
33 | sqlite3_stmt *hydrate_statement;
34 | }
35 |
36 | + (WHArticleCache *)sharedCache;
37 | -(void)finalizeStatements;
38 | - (void)createEditableCopyOfDatabaseIfNeeded;
39 | - (void)initializeDatabase;
40 | - (BOOL)cacheArticle:(WHArticle *)article;
41 | - (WHArticle *)cachedArticleWithIdentifier:(NSString *)identifier;
42 | - (void)deleteOldCache;
43 | - (NSArray *)findArticlesWithQuery:(NSString *)query;
44 | - (void)cleanup;
45 |
46 | // Internal method. Don't call.
47 | - (void)hydrateArticle:(WHArticle *)article;
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/CXMLNode.h:
--------------------------------------------------------------------------------
1 | //
2 | // CXMLNode.h
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 03/07/08.
6 | // Copyright 2008 Toxic Software. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #include
12 |
13 | typedef enum {
14 | CXMLInvalidKind = 0,
15 | CXMLElementKind = XML_ELEMENT_NODE,
16 | CXMLAttributeKind = XML_ATTRIBUTE_NODE,
17 | CXMLTextKind = XML_TEXT_NODE,
18 | CXMLProcessingInstructionKind = XML_PI_NODE,
19 | CXMLCommentKind = XML_COMMENT_NODE,
20 | CXMLNotationDeclarationKind = XML_NOTATION_NODE,
21 | CXMLDTDKind = XML_DTD_NODE,
22 | CXMLElementDeclarationKind = XML_ELEMENT_DECL,
23 | CXMLAttributeDeclarationKind = XML_ATTRIBUTE_DECL,
24 | CXMLEntityDeclarationKind = XML_ENTITY_DECL,
25 | CXMLNamespaceKind = XML_NAMESPACE_DECL,
26 | } CXMLNodeKind;
27 |
28 | @class CXMLDocument;
29 |
30 | // NSXMLNode
31 | @interface CXMLNode : NSObject {
32 | xmlNodePtr _node;
33 | }
34 |
35 | - (CXMLNodeKind)kind;
36 | - (NSString *)name;
37 | - (NSString *)stringValue;
38 | - (NSUInteger)index;
39 | - (NSUInteger)level;
40 | - (CXMLDocument *)rootDocument;
41 | - (CXMLNode *)parent;
42 | - (NSUInteger)childCount;
43 | - (NSArray *)children;
44 | - (CXMLNode *)childAtIndex:(NSUInteger)index;
45 | - (CXMLNode *)previousSibling;
46 | - (CXMLNode *)nextSibling;
47 | //- (CXMLNode *)previousNode;
48 | //- (CXMLNode *)nextNode;
49 | //- (NSString *)XPath;
50 | //- (NSString *)localName;
51 | //- (NSString *)prefix;
52 | //- (NSString *)URI;
53 | //+ (NSString *)localNameForName:(NSString *)name;
54 | //+ (NSString *)prefixForName:(NSString *)name;
55 | //+ (CXMLNode *)predefinedNamespaceForPrefix:(NSString *)name;
56 | - (NSString *)description;
57 | - (NSString *)XMLString;
58 | - (NSString *)XMLStringWithOptions:(NSUInteger)options;
59 | //- (NSString *)canonicalXMLStringPreservingComments:(BOOL)comments;
60 | - (NSArray *)nodesForXPath:(NSString *)xpath error:(NSError **)error;
61 |
62 | - (NSString*)_XMLStringWithOptions:(NSUInteger)options appendingToString:(NSMutableString*)str;
63 | @end
64 |
--------------------------------------------------------------------------------
/Classes/Views/WHNetworkAlertView.m:
--------------------------------------------------------------------------------
1 | //
2 | // WHNetworkAlertView.m
3 | // wikiHow
4 | //
5 | // Created by Keishi Hattori on 4/8/09.
6 | // Copyright 2009 __MyCompanyName__. All rights reserved.
7 | //
8 |
9 | #import "WHNetworkAlertView.h"
10 |
11 |
12 | @implementation WHNetworkAlertView
13 |
14 |
15 | - (id)initWithError:(NSError *)error {
16 | [UIAppDelegate lockShake];
17 | if ([error code] == -1009) {
18 | [self initWithTitle:@"You are not connected to the Internet." message:@"To read or search for articles that are not stored on your device, you must connect to the Internet. While offline, you can still read articles in the Survival Kit or your bookmarks." delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", @"Survival Kit", @"Bookmarks", nil];
19 | noConnectionAlert = YES;
20 | } else {
21 | [self initWithTitle:@"Network Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
22 | noConnectionAlert = NO;
23 | }
24 | return self;
25 | }
26 |
27 | - (void)_selectTabForButtonIndex:(NSInteger)buttonIndex {
28 | if (buttonIndex == 1) {
29 | if (UIAppDelegate.tabBarController.selectedIndex == 0) {
30 | [(UINavigationController *)[UIAppDelegate.tabBarController selectedViewController] popToRootViewControllerAnimated:YES];
31 | } else {
32 | UIAppDelegate.tabBarController.selectedIndex = 0;
33 | }
34 | } else if (buttonIndex == 2) {
35 | if (UIAppDelegate.tabBarController.selectedIndex == 2) {
36 | [(UINavigationController *)[UIAppDelegate.tabBarController selectedViewController] popToRootViewControllerAnimated:YES];
37 | } else {
38 | UIAppDelegate.tabBarController.selectedIndex = 2;
39 | }
40 | }
41 | }
42 |
43 | - (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated {
44 | [UIAppDelegate unlockShake];
45 | if (noConnectionAlert) {
46 | [self _selectTabForButtonIndex:buttonIndex];
47 | }
48 | [super dismissWithClickedButtonIndex:buttonIndex animated:animated];
49 | }
50 |
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/Classes/Libraries/JSON/JSON.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2007, Stig Brautaset. All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | Neither the name of the author nor the names of its contributors may be used
15 | to endorse or promote products derived from this software without specific
16 | prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | /**
31 | @mainpage A strict JSON parser and generator for Objective-C
32 |
33 | JSON (JavaScript Object Notation) is a lightweight data-interchange
34 | format. This framework provides two apis for parsing and generating
35 | JSON. One standard object-based and a higher level api consisting of
36 | categories added to existing Objective-C classes.
37 |
38 | Learn more on the http://code.google.com/p/json-framework project site.
39 | */
40 |
41 | #import "SBJSON.h"
42 | #import "NSObject+SBJSON.h"
43 | #import "NSString+SBJSON.h"
44 |
45 |
--------------------------------------------------------------------------------
/Classes/Models/WHArticlePreloadedCache.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 | #import "sqlite3.h"
26 | #import "WHArticle.h"
27 |
28 |
29 | @interface WHArticlePreloadedCache : NSObject {
30 | sqlite3 *database;
31 | sqlite3_stmt *load_statement;
32 | sqlite3_stmt *search_statement;
33 | sqlite3_stmt *category_search_statement;
34 | sqlite3_stmt *hydrate_statement;
35 | sqlite3_stmt *listup_statement;
36 | }
37 |
38 | + (WHArticlePreloadedCache *)sharedPreloadedCache;
39 | -(void)finalizeStatements;
40 | - (void)initializeDatabase;
41 | - (WHArticle *)cachedArticleWithIdentifier:(NSString *)identifier;
42 | - (NSArray *)preloadedArticles:(NSString *)category;
43 | - (NSArray *)findArticlesWithQuery:(NSString *)query;
44 | - (NSArray *)preloadedCategories;
45 | - (NSArray *)findArticlesWithCategory:(NSString *)category;
46 | - (void)cleanup;
47 |
48 | // Internal method. Don't call.
49 | - (void)hydrateArticle:(WHArticle *)article;
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/Classes/Views/WHMultiValuePreferenceCell.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHMultiValuePreferenceCell.h"
25 |
26 |
27 | @implementation WHMultiValuePreferenceCell
28 |
29 | @synthesize valueLabel;
30 |
31 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
32 | if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
33 | valueLabel = [[UILabel alloc] initWithFrame:CGRectMake(200.0, 6.0, 80.0, 32.0)];
34 | valueLabel.textColor = [UIColor colorWithRed:0.20 green:0.31 blue:0.52 alpha:1.0];
35 | valueLabel.textAlignment = UITextAlignmentRight;
36 | [self addSubview:valueLabel];
37 | [valueLabel release];
38 | }
39 | return self;
40 | }
41 |
42 |
43 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
44 |
45 | [super setSelected:selected animated:animated];
46 |
47 | valueLabel.textColor = selected ? [UIColor whiteColor] : [UIColor colorWithRed:0.20 green:0.31 blue:0.52 alpha:1.0];
48 | }
49 |
50 |
51 | - (void)dealloc {
52 | [super dealloc];
53 | }
54 |
55 |
56 | @end
57 |
--------------------------------------------------------------------------------
/Classes/Libraries/HTTPClient/KCHTTPClient.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 |
27 | @interface KCHTTPClient : NSObject {
28 | id delegate;
29 | NSString *userAgent;
30 | NSString *referer;
31 | NSUInteger maximumRedirects;
32 | NSURLConnection *connection;
33 | NSHTTPURLResponse *response;
34 | NSMutableData *buffer;
35 | NSUInteger redirectCount;
36 | }
37 |
38 | @property (nonatomic, assign) id delegate;
39 | @property (nonatomic, copy) NSString *userAgent;
40 | @property (nonatomic, copy) NSString *referer;
41 | @property (nonatomic, assign) NSUInteger maximumRedirects;
42 |
43 | + (NSString *)buildQueryString:(NSDictionary *)params;
44 | - (void)cancel;
45 | - (void)get:(NSURL *)URL parameters:(NSDictionary *)params;
46 | - (void)post:(NSURL *)URL parameters:(NSDictionary *)params;
47 | - (BOOL)isLoading;
48 |
49 | @end
50 |
51 | @protocol KCHTTPClientDelegate
52 |
53 | - (void)HTTPClientDidSucceed:(KCHTTPClient *)sender response:(NSHTTPURLResponse *)response data:(NSData *)data;
54 | - (void)HTTPClientDidFail:(KCHTTPClient *)sender error:(NSError *)error;
55 | - (void)HTTPClientDownloading:(KCHTTPClient *)sender progress:(float)progress;
56 |
57 | @end
58 |
59 |
--------------------------------------------------------------------------------
/Classes/Libraries/NetworkActivityIndicator/KCNetworkActivityIndicator.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "KCNetworkActivityIndicator.h"
25 |
26 | static KCNetworkActivityIndicator *sharedIndicator = nil;
27 |
28 | @implementation KCNetworkActivityIndicator
29 |
30 | @synthesize count;
31 |
32 | + (KCNetworkActivityIndicator *)sharedIndicator {
33 | if (sharedIndicator == nil) {
34 | sharedIndicator = [[KCNetworkActivityIndicator alloc] init];
35 | }
36 | return sharedIndicator;
37 | }
38 |
39 | - (id)init {
40 | if (self = [super init]) {
41 | count = 0;
42 | }
43 | return self;
44 | }
45 |
46 | - (id)retain {
47 | return self;
48 | }
49 |
50 | - (NSUInteger)retainCount {
51 | return NSUIntegerMax;
52 | }
53 |
54 | - (void)release {
55 | }
56 |
57 | - (id)autorelease {
58 | return self;
59 | }
60 |
61 | - (void)start {
62 | if (count == 0) {
63 | [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
64 | }
65 | count++;
66 | }
67 |
68 | - (void)stop {
69 | #ifdef DEBUG
70 | NSAssert(count != 0, @"KCNetworkActivityIndicator: Incorrect indicator count.");
71 | #endif
72 | count--;
73 | if (count == 0) {
74 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
75 | }
76 | }
77 |
78 | @end
79 |
--------------------------------------------------------------------------------
/Classes/Helper/NSString+wikiHow.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "NSString+wikiHow.h"
25 | #import "NSString+HTTPClient.h"
26 |
27 |
28 | @implementation NSString (wikiHow)
29 |
30 | - (NSString *)stringEscapedWikiHowStyle {
31 | NSString *s = [self stringByReplacingOccurrencesOfString:@" " withString:@"-"];
32 | return [s stringEscapedAsURIComponent];
33 | }
34 |
35 | - (NSString *)stringUnescapedWikiHowStyle {
36 | NSString *s = [self stringUnescapedAsURIComponent];
37 | return [s stringByReplacingOccurrencesOfString:@"-" withString:@" "];
38 | }
39 |
40 | - (NSString *)identifierTitle {
41 | NSRange r = [self rangeOfString:@":"];
42 | return [self substringFromIndex:(r.location+1)];
43 | }
44 |
45 | - (NSString *)identifierNamespace {
46 | NSRange r = [self rangeOfString:@":"];
47 | return [self substringToIndex:r.location];
48 | }
49 |
50 | - (NSString *)normalizedJSONString {
51 | NSRange startRange = [self rangeOfString:@"{"];
52 | NSRange endRange = [self rangeOfString:@"}" options:(NSLiteralSearch | NSBackwardsSearch)];
53 | NSRange JSONRange;
54 | JSONRange.location = startRange.location;
55 | JSONRange.length = endRange.location - startRange.location + 1;
56 | return [self substringWithRange:JSONRange];
57 | }
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/Classes/Libraries/JSON/NSString+SBJSON.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2007 Stig Brautaset. All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | Neither the name of the author nor the names of its contributors may be used
15 | to endorse or promote products derived from this software without specific
16 | prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #import
31 |
32 | /// Adds JSON parsing to NSString
33 | @interface NSString (NSString_SBJSON)
34 |
35 | /// Returns the object represented in the receiver, or nil on error.
36 | - (id)JSONFragmentValue;
37 |
38 | /// Returns the dictionary or array represented in the receiver, or nil on error.
39 | - (id)JSONValue;
40 |
41 | /**
42 | @brief Returns the dictionary or array represented in the receiver, or nil on error.
43 | @param opts a dictionary of options
44 |
45 | Only one option is supported: MaxDepth. Set it to the maximum recursion level you want to support. 0 means no maximum level; the default is 512.
46 |
47 | @deprecated This method is deprecated. Use an instance of the SBJSON class and set the @p maxDepth attribute instead.
48 | */
49 | - (id)JSONValueWithOptions:(NSDictionary *)opts;
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/Classes/Libraries/HTTPClient/NSString+HTTPClient.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "NSString+HTTPClient.h"
25 |
26 |
27 | @implementation NSString (HTTPClient)
28 |
29 | // Javascript compatible encodings
30 |
31 | - (NSString *)stringEscapedAsURI {
32 | return [(NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)self, CFSTR(";,/?:@&=+$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.!~*'()#"), NULL, kCFStringEncodingUTF8) autorelease] ;
33 | }
34 |
35 | - (NSString *)stringEscapedAsURIComponent {
36 | return [(NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)self, CFSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.!~*'()"), CFSTR("&"), kCFStringEncodingUTF8) autorelease] ;
37 | }
38 |
39 | - (NSString *)stringUnescapedAsURI {
40 | return [(NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL, (CFStringRef)self, CFSTR(";,/?:@&=+$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.!~*'()#"), kCFStringEncodingUTF8) autorelease] ;
41 | }
42 |
43 | - (NSString *)stringUnescapedAsURIComponent {
44 | return [(NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL, (CFStringRef)self, CFSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.!~*'()"), kCFStringEncodingUTF8) autorelease] ;
45 | }
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/Classes/Models/WHToggleSwitchPreference.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHToggleSwitchPreference.h"
25 |
26 |
27 | @implementation WHToggleSwitchPreference
28 |
29 | @synthesize cell;
30 | @synthesize key;
31 | @synthesize toggleSwitch;
32 |
33 | - (id)initWithSpecifier:(NSDictionary *)specifier {
34 | if (self = [super init]) {
35 | key = [[specifier objectForKey:@"Key"] copy];
36 |
37 | toggleSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(190, 9, 0, 0)];
38 | [toggleSwitch addTarget:self action:@selector(switchDidChange:) forControlEvents:UIControlEventValueChanged];
39 |
40 | if ([[NSUserDefaults standardUserDefaults] objectForKey:key]) {
41 | toggleSwitch.on = [[NSUserDefaults standardUserDefaults] boolForKey:key];
42 | } else {
43 | toggleSwitch.on = [[[specifier objectForKey:@"DefaultValue"] description] isEqualToString:@"1"];
44 | }
45 |
46 | cell = [[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"ToggleSwitchCell"];
47 | cell.textLabel.text = [specifier objectForKey:@"Title"];
48 | cell.selectionStyle = UITableViewCellSelectionStyleNone;
49 | [cell addSubview:toggleSwitch];
50 | }
51 | return self;
52 | }
53 |
54 | - (void)switchDidChange:(id)sender {
55 | [[NSUserDefaults standardUserDefaults] setBool:toggleSwitch.on forKey:key];
56 | }
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/Classes/Libraries/Debug/KCLogger.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 |
26 | #ifdef DEBUG
27 | #define KCLog(s,...) [KCLogger logFile:__FILE__ lineNumber:__LINE__ format:(s),##__VA_ARGS__]
28 | #else
29 | #define KCLog(...)
30 | #endif
31 |
32 | #define KCLogOrientation(o) KCLog( \
33 | o==UIDeviceOrientationUnknown ? @"UIDeviceOrientationUnknown" : \
34 | o==UIDeviceOrientationPortrait ? @"UIDeviceOrientationPortrait" : \
35 | o==UIDeviceOrientationPortraitUpsideDown ? @"UIDeviceOrientationPortraitUpsideDown" : \
36 | o==UIDeviceOrientationLandscapeLeft ? @"UIDeviceOrientationLandscapeLeft" : \
37 | o==UIDeviceOrientationLandscapeRight ? @"UIDeviceOrientationLandscapeRight" : \
38 | o==UIDeviceOrientationFaceUp ? @"UIDeviceOrientationFaceUp" : \
39 | o==UIDeviceOrientationFaceDown ? @"UIDeviceOrientationFaceDown" : @"Unknown")
40 | #define KCLogRect(r) KCLog(@"{{%f,%f},{%f,%f}}", r.origin.x, r.origin.y, r.size.width, r.size.height)
41 | #define KCLogSize(s) KCLog(@"{%f,%f}", s.width, s.height)
42 | #define KCLogPoint(p) KCLog(@"{%f,%f}", p.x, p.y)
43 | #define KCLogInt(i) KCLog(@"%d", i)
44 | #define KCLogFloat(f) KCLog(@"%f", f)
45 | #define KCLogObject(o) KCLog(@"%@", o)
46 |
47 | @interface KCLogger : NSObject {
48 |
49 | }
50 |
51 | + (void)logFile:(char*)sourceFile lineNumber:(int)lineNumber format:(NSString*)format, ...;
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/Classes/Libraries/GoogleToolbox/GTMNSString+HTML.h:
--------------------------------------------------------------------------------
1 | //
2 | // GTMNSString+HTML.h
3 | // Dealing with NSStrings that contain HTML
4 | //
5 | // Copyright 2006-2008 Google Inc.
6 | //
7 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not
8 | // use this file except in compliance with the License. You may obtain a copy
9 | // of the License at
10 | //
11 | // http://www.apache.org/licenses/LICENSE-2.0
12 | //
13 | // Unless required by applicable law or agreed to in writing, software
14 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | // License for the specific language governing permissions and limitations under
17 | // the License.
18 | //
19 |
20 | #import
21 |
22 | /// Utilities for NSStrings containing HTML
23 | @interface NSString (GTMNSStringHTMLAdditions)
24 |
25 | /// Get a string where internal characters that need escaping for HTML are escaped
26 | //
27 | /// For example, '&' become '&'. This will only cover characters from table
28 | /// A.2.2 of http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters
29 | /// which is what you want for a unicode encoded webpage. If you have a ascii
30 | /// or non-encoded webpage, please use stringByEscapingAsciiHTML which will
31 | /// encode all characters.
32 | ///
33 | /// For obvious reasons this call is only safe once.
34 | //
35 | // Returns:
36 | // Autoreleased NSString
37 | //
38 | - (NSString *)gtm_stringByEscapingForHTML;
39 |
40 | /// Get a string where internal characters that need escaping for HTML are escaped
41 | //
42 | /// For example, '&' become '&'
43 | /// All non-mapped characters (unicode that don't have a &keyword; mapping)
44 | /// will be converted to the appropriate xx; value. If your webpage is
45 | /// unicode encoded (UTF16 or UTF8) use stringByEscapingHTML instead as it is
46 | /// faster, and produces less bloated and more readable HTML (as long as you
47 | /// are using a unicode compliant HTML reader).
48 | ///
49 | /// For obvious reasons this call is only safe once.
50 | //
51 | // Returns:
52 | // Autoreleased NSString
53 | //
54 | - (NSString *)gtm_stringByEscapingForAsciiHTML;
55 |
56 | /// Get a string where internal characters that are escaped for HTML are unescaped
57 | //
58 | /// For example, '&' becomes '&'
59 | /// Handles and 2 cases as well
60 | ///
61 | // Returns:
62 | // Autoreleased NSString
63 | //
64 | - (NSString *)gtm_stringByUnescapingFromHTML;
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/Classes/wikiHowAppDelegate.h:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import
25 | #import "SoundEffect.h"
26 | #import "WHTipsViewController.h"
27 |
28 | #define UIAppDelegate ((wikiHowAppDelegate *)[UIApplication sharedApplication].delegate)
29 |
30 | @interface wikiHowAppDelegate : NSObject {
31 | UIWindow *window;
32 | UIView *landscapeView;
33 | UITabBarController *tabBarController;
34 | NSURL *openDialogURL;
35 | NSString *version;
36 | NSString *tabname;
37 | SoundEffect *shakeSound;
38 | UIAccelerationValue myAccelerometer[3];
39 | CFTimeInterval lastTime;
40 | WHTipsViewController *tipsViewController;
41 | BOOL isShakeEnabled;
42 | UILabel *landscapeLoadingLabel;
43 | NSInteger shakeLockCount;
44 | }
45 |
46 | @property (nonatomic, retain) IBOutlet UIWindow *window;
47 | @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
48 | @property (nonatomic, readonly) UIView *landscapeView;
49 | @property (nonatomic, readonly) NSString *version;
50 | @property (nonatomic, readonly) NSString *tabname;
51 | @property (nonatomic, readonly) WHTipsViewController *tipsViewController;
52 | @property (nonatomic, assign) BOOL isShakeEnabled;
53 |
54 | - (void)openURLWithAlert:(NSURL *)URL;
55 | - (void)showTips;
56 | - (void)hideTips;
57 | - (void)showLandscapeView;
58 | - (void)hideLandscapeView;
59 | - (void)lockShake;
60 | - (void)unlockShake;
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/Classes/Views/WHImageScrollView.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHImageScrollView.h"
25 |
26 |
27 | @implementation WHImageScrollView
28 |
29 | - (void)setImage:(UIImage *)image {
30 | CGSize imageSize = image.size;
31 | CGRect viewFrame = self.frame;
32 | float imageAspectRatio = imageSize.width / imageSize.height;
33 | float viewAspectRatio = viewFrame.size.width / viewFrame.size.height;
34 | imageView = [[UIImageView alloc] initWithImage:image];
35 | imageView.frame = (imageAspectRatio > viewAspectRatio) ?
36 | CGRectMake(0, 0, viewFrame.size.width, viewFrame.size.width / imageSize.width * imageSize.height) :
37 | CGRectMake(0, 0, viewFrame.size.height / imageSize.height * imageSize.width, viewFrame.size.height);
38 | [self addSubview:imageView];
39 | [imageView release];
40 | [self setContentOffset:CGPointMake(0.0, 0.0)];
41 | }
42 |
43 | - (void)setContentOffset:(CGPoint)p {
44 | CGSize viewSize = self.contentSize;
45 | if (self.delegate) {
46 | UIView *contentView = [self.delegate viewForZoomingInScrollView:self];
47 | if (contentView) {
48 | viewSize = contentView.frame.size;
49 | CGSize scrollSize = self.bounds.size;
50 | if(viewSize.width < scrollSize.width)
51 | {
52 | p.x = -(scrollSize.width - viewSize.width) / 2.0;
53 | }
54 | if(viewSize.height < scrollSize.height)
55 | {
56 | p.y = -(scrollSize.height - viewSize.height) / 2.0;
57 | }
58 | }
59 | }
60 | super.contentOffset = p;
61 | }
62 |
63 | - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
64 | return imageView;
65 | }
66 |
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/Classes/Libraries/JSON/NSString+SBJSON.m:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2007 Stig Brautaset. All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | Neither the name of the author nor the names of its contributors may be used
15 | to endorse or promote products derived from this software without specific
16 | prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #import "NSString+SBJSON.h"
31 | #import "SBJSON.h"
32 |
33 |
34 | @implementation NSString (NSString_SBJSON)
35 |
36 | - (id)JSONFragmentValueWithOptions:(NSDictionary *)opts
37 | {
38 | SBJSON *json = [SBJSON new];
39 |
40 | if (opts) {
41 | id opt = [opts objectForKey:@"MaxDepth"];
42 | if (opt)
43 | [json setMaxDepth:[opt intValue]];
44 | }
45 |
46 | NSError *error;
47 | id o = [json fragmentWithString:self error:&error];
48 | if (!o)
49 | NSLog(@"%@", error);
50 | [json release];
51 | return o;
52 | }
53 |
54 |
55 | - (id)JSONValueWithOptions:(NSDictionary *)opts
56 | {
57 | SBJSON *json = [SBJSON new];
58 |
59 | if (opts) {
60 | id opt = [opts objectForKey:@"MaxDepth"];
61 | if (opt)
62 | [json setMaxDepth:[opt intValue]];
63 | }
64 |
65 | NSError *error;
66 | id o = [json objectWithString:self error:&error];
67 | if (!o)
68 | NSLog(@"%@", error);
69 | [json release];
70 | return o;
71 | }
72 |
73 | - (id)JSONFragmentValue
74 | {
75 | return [self JSONFragmentValueWithOptions:nil];
76 | }
77 |
78 | - (id)JSONValue
79 | {
80 | return [self JSONValueWithOptions:nil];
81 | }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/Classes/Libraries/SoundEffect/SoundEffect.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | File: SoundEffect.h
4 | Abstract: SoundEffect is a class that loads and plays sound files.
5 |
6 | Version: 1.6
7 |
8 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc.
9 | ("Apple") in consideration of your agreement to the following terms, and your
10 | use, installation, modification or redistribution of this Apple software
11 | constitutes acceptance of these terms. If you do not agree with these terms,
12 | please do not use, install, modify or redistribute this Apple software.
13 |
14 | In consideration of your agreement to abide by the following terms, and subject
15 | to these terms, Apple grants you a personal, non-exclusive license, under
16 | Apple's copyrights in this original Apple software (the "Apple Software"), to
17 | use, reproduce, modify and redistribute the Apple Software, with or without
18 | modifications, in source and/or binary forms; provided that if you redistribute
19 | the Apple Software in its entirety and without modifications, you must retain
20 | this notice and the following text and disclaimers in all such redistributions
21 | of the Apple Software.
22 | Neither the name, trademarks, service marks or logos of Apple Inc. may be used
23 | to endorse or promote products derived from the Apple Software without specific
24 | prior written permission from Apple. Except as expressly stated in this notice,
25 | no other rights or licenses, express or implied, are granted by Apple herein,
26 | including but not limited to any patent rights that may be infringed by your
27 | derivative works or by other works in which the Apple Software may be
28 | incorporated.
29 |
30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
31 | WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
32 | WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33 | PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
34 | COMBINATION WITH YOUR PRODUCTS.
35 |
36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
37 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
38 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 | ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR
40 | DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF
41 | CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
42 | APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2008 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 | #import
50 |
51 | @interface SoundEffect : NSObject {
52 | SystemSoundID _soundID;
53 | }
54 |
55 | + (id)soundEffectWithContentsOfFile:(NSString *)aPath;
56 | - (id)initWithContentsOfFile:(NSString *)path;
57 | - (void)play;
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/Classes/Libraries/JSON/NSObject+SBJSON.m:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2007 Stig Brautaset. All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | Neither the name of the author nor the names of its contributors may be used
15 | to endorse or promote products derived from this software without specific
16 | prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #import "NSObject+SBJSON.h"
31 | #import "SBJSON.h"
32 |
33 | @implementation NSObject (NSObject_SBJSON)
34 |
35 | - (NSString *)JSONFragment {
36 | SBJSON *generator = [SBJSON new];
37 |
38 | NSError *error;
39 | NSString *json = [generator stringWithFragment:self error:&error];
40 | [generator release];
41 |
42 | if (!json)
43 | NSLog(@"%@", error);
44 | return json;
45 | }
46 |
47 | - (NSString *)JSONRepresentation {
48 | SBJSON *generator = [SBJSON new];
49 |
50 | NSError *error;
51 | NSString *json = [generator stringWithObject:self error:&error];
52 | [generator release];
53 |
54 | if (!json)
55 | NSLog(@"%@", error);
56 | return json;
57 | }
58 |
59 | - (NSString *)JSONRepresentationWithOptions:(NSDictionary *)x {
60 | SBJSON *generator = [SBJSON new];
61 |
62 | id o;
63 | if (o = [x objectForKey:@"HumanReadable"])
64 | [generator setHumanReadable:[o boolValue]];
65 |
66 | if (o = [x objectForKey:@"MultiLine"])
67 | [generator setHumanReadable:[o boolValue]];
68 |
69 | if (o = [x objectForKey:@"Pretty"])
70 | [generator setHumanReadable:[o boolValue]];
71 |
72 | NSError *error;
73 | NSString *json = [generator stringWithObject:self error:&error];
74 | [generator release];
75 |
76 | if (!json)
77 | NSLog(@"%@", error);
78 | return json;
79 | }
80 |
81 | @end
82 |
--------------------------------------------------------------------------------
/Classes/Libraries/JSON/NSObject+SBJSON.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2007 Stig Brautaset. All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | Neither the name of the author nor the names of its contributors may be used
15 | to endorse or promote products derived from this software without specific
16 | prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #import
31 |
32 |
33 | /// Adds JSON generation to NSObject subclasses
34 | @interface NSObject (NSObject_SBJSON)
35 |
36 | /**
37 | @brief Returns a string containing the receiver encoded as a JSON fragment.
38 |
39 | This method is added as a category on NSObject but is only actually
40 | supported for the following objects:
41 | @li NSDictionary
42 | @li NSArray
43 | @li NSString
44 | @li NSNumber (also used for booleans)
45 | @li NSNull
46 | */
47 | - (NSString *)JSONFragment;
48 |
49 | /**
50 | @brief Returns a string containing the receiver encoded in JSON.
51 |
52 | This method is added as a category on NSObject but is only actually
53 | supported for the following objects:
54 | @li NSDictionary
55 | @li NSArray
56 | */
57 | - (NSString *)JSONRepresentation;
58 |
59 | /**
60 | @brief Returns a string containing the receiver encoded in JSON.
61 |
62 | Pass in a dictionary with an object that returns a true value for the
63 | @p HumanReadable key, and the returned JSON will be human readable.
64 |
65 | @deprecated This method is deprecated. Use an instance of the SBJSON
66 | class and set the @p humanReadable attribute instead.
67 |
68 | This method is added as a category on NSObject but is only actually
69 | supported for the following objects:
70 | @li NSDictionary
71 | @li NSArray
72 |
73 | */
74 | - (NSString *)JSONRepresentationWithOptions:(NSDictionary *)opts;
75 |
76 | @end
77 |
78 |
--------------------------------------------------------------------------------
/Classes/Views/ABTableViewCell.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2008 Loren Brichter
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 | //
24 | // ABTableViewCell.m
25 | //
26 | // Created by Loren Brichter
27 | // Copyright 2008 Loren Brichter. All rights reserved.
28 | //
29 |
30 | #import "ABTableViewCell.h"
31 | #import
32 |
33 | @interface ABTableViewCellView : UIView
34 | @end
35 |
36 | @implementation ABTableViewCellView
37 |
38 | - (void)drawRect:(CGRect)r
39 | {
40 | [(ABTableViewCell *)[self superview] drawContentView:r];
41 | }
42 |
43 | @end
44 |
45 |
46 |
47 | @implementation ABTableViewCell
48 |
49 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
50 | {
51 | if(self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])
52 | {
53 | contentView = [[ABTableViewCellView alloc] initWithFrame:CGRectZero];
54 | contentView.opaque = YES;
55 | [self addSubview:contentView];
56 | [contentView release];
57 | }
58 | return self;
59 | }
60 |
61 | - (void)dealloc
62 | {
63 | [super dealloc];
64 | }
65 |
66 | - (void)setFrame:(CGRect)f
67 | {
68 | [super setFrame:f];
69 | CGRect b = [self bounds];
70 | b.size.height -= 1; // leave room for the seperator line
71 | [contentView setFrame:b];
72 | }
73 |
74 | - (void)setNeedsDisplay
75 | {
76 | [super setNeedsDisplay];
77 | [contentView setNeedsDisplay];
78 | }
79 |
80 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
81 | [super setSelected:selected animated:animated];
82 | if (animated) {
83 | [contentView setNeedsDisplay];
84 | CATransition *animation = [CATransition animation];
85 | [animation setType:kCATransitionFade];
86 | [animation setDuration:0.3];
87 | [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
88 | [[contentView layer] addAnimation:animation forKey:@"selectAnimation"];
89 | }
90 | }
91 |
92 | - (void)drawContentView:(CGRect)r
93 | {
94 | // subclasses should implement this
95 | }
96 |
97 | @end
98 |
--------------------------------------------------------------------------------
/Classes/Libraries/FlurryLib/FlurryAPI.h:
--------------------------------------------------------------------------------
1 | //
2 | // FlurryAPI.h
3 | // Flurry iPhone Analytics Agent
4 | //
5 | // Copyright 2008 Flurry, Inc. All rights reserved.
6 | //
7 | // The Flurry iPhone Analytics Agent allows you to track the usage and behavior of your iPhone application
8 | // on user's phones for viewing the Flurry Analytics system. It is designed to be as easy as possible
9 | // with a basic setup complete in under 5 minutes.
10 | //
11 | // The easiest way to integrate this with your code is to add a single call to startSession in
12 | // applicationDidFinishLaunching as follows:
13 | //
14 | // - (void)applicationDidFinishLaunching:(UIApplication *)application {
15 | // [FlurryAPI startSession:@"YOUR_API_KEY"];
16 | // //your code
17 | // }
18 | //
19 | // And you're all set! When you build and deploy your application it will report basic metrics
20 | // back to the Flurry servers which are then processed for display on the Flurry Analytics website.
21 | //
22 | // If you'd like to get more detailed location information with your analytics, but require the user
23 | // to approve the access, you can use [FlurryAPI startSessionWithLocationServices:@"YOUR_API_KEY"];
24 | //
25 | // Custom tracking of errors and events are also offered:
26 | //
27 | // [FlurryAPI logEvent:@"YOUR_EVENT_NAME"];
28 | // Use logEvent to count the number of times certain events happen during a session of your application.
29 | // This can be useful for measuring how much users do various actions, for example. Your application is
30 | // currently limited to counting occurrences for 100 different event ids (maximum length 255 characters).
31 | //
32 | // [FlurryAPI logError:@"YOUR_ERROR_NAME" message:@"YOUR_ERROR_DESCRIPTION" exception:e];
33 | // Use logError to report application errors. Flurry will report the first 10 errors to occur
34 | // in each session.
35 | //
36 |
37 | #import
38 |
39 | @interface FlurryAPI : NSObject {
40 | }
41 |
42 | // Call startSession with your project apiKey in applicationDidFinishLaunching
43 | // + This call will initiate tracking of the current user session and send any previously saved
44 | // sessions to the Flurry analytics servers.
45 | + (void)startSession:(NSString *)apiKey;
46 |
47 | // Use this instead of startSession if you want detailed location information in your analytics.
48 | + (void)startSessionWithLocationServices:(NSString *)apiKey;
49 |
50 | // Call logError to track any errors in your application that you would like to view in your analytics.
51 | // + Errors are uniquely identified and correlated by errorID so two different calls using the same
52 | // errorID will be considered the same error type.
53 | + (void)logError:(NSString *)errorID message:(NSString *)message exception:(NSException *)exception;
54 |
55 | // Call logEvent to track any custom events in your application, such as user behaviors or application
56 | // execution points. The eventName is considered unique so two different calls using the same
57 | // eventName will be considered the same event type.
58 | + (void)logEvent:(NSString *)eventName;
59 |
60 | // You should not need this function.
61 | + (void)setServerURL:(NSString *)url;
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/Classes/Views/WHSearchField.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHSearchField.h"
25 |
26 |
27 | @implementation WHSearchField
28 |
29 |
30 | - (id)initWithFrame:(CGRect)frame {
31 | if (self = [super initWithFrame:frame]) {
32 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:nil];
33 |
34 | UIImage *backgroundImage = [[UIImage imageNamed:@"SearchField.png"] stretchableImageWithLeftCapWidth:16 topCapHeight:16];
35 | self.background = backgroundImage;
36 | UIImageView *magnifyingGlassView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"MagnifyingGlass.png"]];
37 | self.leftView = magnifyingGlassView;
38 | self.leftViewMode = UITextFieldViewModeAlways;
39 | [magnifyingGlassView release];
40 | }
41 | return self;
42 | }
43 |
44 | - (void)textFieldTextDidChange:(NSNotification *)notification {
45 | if ([notification object] == self) {
46 | if ([self.delegate respondsToSelector:@selector(searchField:textDidChange:)]) {
47 | [self.delegate performSelector:@selector(searchField:textDidChange:) withObject:self withObject:self.text];
48 | }
49 | }
50 | }
51 |
52 | - (CGRect)textRectForBounds:(CGRect)bounds {
53 | CGRect original = [super textRectForBounds:bounds];
54 | return CGRectMake(original.origin.x, original.origin.y+2, original.size.width, original.size.height-4);
55 | }
56 |
57 | - (CGRect)editingRectForBounds:(CGRect)bounds {
58 | CGRect original = [super editingRectForBounds:bounds];
59 | return CGRectMake(original.origin.x, original.origin.y+2, original.size.width, original.size.height-4);
60 | }
61 |
62 | - (CGRect)clearButtonRectForBounds:(CGRect)bounds {
63 | CGRect original = [super clearButtonRectForBounds:bounds];
64 | return CGRectMake(original.origin.x, original.origin.y, original.size.width, original.size.height);
65 | }
66 |
67 | - (CGRect)leftViewRectForBounds:(CGRect)bounds {
68 | return CGRectMake(10.0, 8.0, 16.0, 16.0);
69 | }
70 |
71 | @end
72 |
--------------------------------------------------------------------------------
/Classes/Models/WHArticle.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHArticle.h"
25 | #import "WHArticleCache.h"
26 | #import "NSString+wikiHow.h"
27 | #import "WHArticlePreloadedCache.h"
28 |
29 |
30 | @implementation WHArticle
31 |
32 | @synthesize title;
33 | @synthesize category;
34 | @synthesize isCached;
35 |
36 | + (NSString *)titleWithIdentifier:(NSString *)anIdentifier {
37 | return [[anIdentifier identifierTitle] stringUnescapedWikiHowStyle];
38 | }
39 |
40 | - (id)init {
41 | if (self = [super init]) {
42 | identifier = nil;
43 | title = nil;
44 | HTML = nil;
45 | category = nil;
46 | isCached = NO;
47 | }
48 | return self;
49 | }
50 |
51 | - (void)dealloc {
52 | [identifier release];
53 | [title release];
54 | [HTML release];
55 | [category release];
56 | [super dealloc];
57 | }
58 |
59 | - (void)didReceiveMemoryWarning {
60 | [HTML release];
61 | HTML = nil;
62 | }
63 |
64 | #pragma mark Setter/Getter Methods
65 |
66 | - (void)setIdentifier:(NSString *)newIdentifier {
67 | if (![[newIdentifier identifierNamespace] isEqualToString:@"Article"]) {
68 | NSException *exception = [NSException exceptionWithName:@"WHInvalidIdentifier" reason:@"Identifier doesn't have proper namespace:Article" userInfo:nil];
69 | @throw exception;
70 | return;
71 | }
72 |
73 | if (identifier != newIdentifier) {
74 | [identifier release];
75 | identifier = [newIdentifier copy];
76 | }
77 | }
78 |
79 | - (NSString *)identifier {
80 | return identifier;
81 | }
82 |
83 | - (void)setHTML:(NSString *)newHTML {
84 | if (HTML != newHTML) {
85 | [HTML release];
86 | HTML = [newHTML copy];
87 | }
88 | }
89 |
90 | - (NSString *)HTML {
91 | if (HTML == nil && isCached) {
92 | [[WHArticleCache sharedCache] hydrateArticle:self];
93 | if (HTML == nil) {
94 | [[WHArticlePreloadedCache sharedPreloadedCache] hydrateArticle:self];
95 | }
96 | }
97 | return HTML;
98 | }
99 |
100 | @end
101 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHTipsViewController.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHTipsViewController.h"
25 |
26 |
27 | @implementation WHTipsViewController
28 |
29 | - (void)loadView {
30 | UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
31 | contentView.backgroundColor = [UIColor clearColor];
32 | contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
33 | self.view = contentView;
34 | [contentView release];
35 |
36 | UINavigationBar *navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320.0, 44.0)];
37 | self.navigationItem.title = @"wikiHow Tips";
38 | UIBarButtonItem *doneButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:UIAppDelegate action:@selector(hideTips)];
39 | self.navigationItem.rightBarButtonItem = doneButtonItem;
40 | [doneButtonItem release];
41 | navigationBar.barStyle = UIBarStyleBlackOpaque;
42 | [navigationBar pushNavigationItem:self.navigationItem animated:NO];
43 | [contentView addSubview:navigationBar];
44 |
45 | UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Tips.png"]];
46 | CGRect imageViewFrame = imageView.frame;
47 | imageViewFrame.origin.y = 44.0;
48 | imageView.frame = imageViewFrame;
49 | [contentView addSubview:imageView];
50 | [imageView release];
51 |
52 | UIButton *tosButton = [[UIButton alloc] initWithFrame:CGRectMake(144, 79, 126, 26)];
53 | [tosButton addTarget:self action:@selector(showTOS) forControlEvents:UIControlEventTouchUpInside];
54 | [tosButton setImage:[UIImage imageNamed:@"TOS.png"] forState:UIControlStateNormal];
55 | [tosButton setImage:[UIImage imageNamed:@"TOSSelected.png"] forState:UIControlStateHighlighted];
56 | [contentView addSubview:tosButton];
57 | [tosButton release];
58 |
59 | UIButton *startButton = [[UIButton alloc] initWithFrame:CGRectMake(74, 280, 172, 57)];
60 | startButton.backgroundColor = [UIColor clearColor];
61 | [startButton addTarget:UIAppDelegate action:@selector(hideTips) forControlEvents:UIControlEventTouchUpInside];
62 | [startButton setImage:[UIImage imageNamed:@"StartButton.png"] forState:UIControlStateNormal];
63 | [contentView addSubview:startButton];
64 | [startButton release];
65 | }
66 |
67 | - (void)showTOS {
68 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.wikihow.com/Terms-of-Use"]];
69 | }
70 |
71 | @end
72 |
--------------------------------------------------------------------------------
/Classes/Models/WHBookmarksDataSource.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHBookmarksDataSource.h"
25 | #import "WHBookmark.h"
26 |
27 | static WHBookmarksDataSource *sharedDataSource = nil;
28 |
29 | @implementation WHBookmarksDataSource
30 |
31 | @synthesize bookmarks;
32 | @synthesize lastModified;
33 |
34 | + (WHBookmarksDataSource *)sharedDataSource {
35 | if (sharedDataSource == nil) {
36 | sharedDataSource = [[WHBookmarksDataSource alloc] init];
37 | }
38 | return sharedDataSource;
39 | }
40 |
41 | - (id)init {
42 | if (self = [super init]) {
43 | NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
44 | NSData *bookmarksData = [standardUserDefaults objectForKey:@"bookmarks"];
45 | lastModified = [[NSDate alloc] init];
46 | lastSaved = [[NSDate alloc] init];
47 | if (bookmarksData) {
48 | bookmarks = [[NSKeyedUnarchiver unarchiveObjectWithData:bookmarksData] retain];
49 | } else {
50 | bookmarks = [[NSMutableArray alloc] init];
51 | }
52 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveIfNeeded) name:UIApplicationWillTerminateNotification object:nil];
53 | [NSTimer scheduledTimerWithTimeInterval:(5 * 60) target:self selector:@selector(saveIfNeeded) userInfo:nil repeats:YES];
54 | }
55 | return self;
56 | }
57 |
58 | - (void)saveIfNeeded {
59 | if ([lastSaved compare:lastModified] == NSOrderedAscending) {
60 | [self save];
61 | }
62 | }
63 |
64 | - (void)save {
65 | NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
66 | [standardUserDefaults setObject:[NSKeyedArchiver archivedDataWithRootObject:bookmarks] forKey:@"bookmarks"];
67 | [lastSaved release];
68 | lastSaved = [[NSDate alloc] init];
69 | }
70 |
71 | - (void)bookmarkArticle:(WHArticle *)article {
72 | if ([self isBookmarked:article.identifier]) {
73 | return;
74 | }
75 | WHBookmark *bookmark = [[WHBookmark alloc] init];
76 | bookmark.title = article.title;
77 | bookmark.identifier = article.identifier;
78 | [bookmarks addObject:bookmark];
79 | [bookmark release];
80 | [self updateLastModified];
81 | }
82 |
83 | - (BOOL)isBookmarked:(NSString *)identifier {
84 | WHBookmark *bookmark;
85 | for (bookmark in bookmarks) {
86 | if ([bookmark.identifier isEqualToString:identifier]) {
87 | return YES;
88 | }
89 | }
90 | return NO;
91 | }
92 |
93 | - (void)updateLastModified {
94 | [lastModified release];
95 | lastModified = [[NSDate alloc] init];
96 | }
97 |
98 |
99 | @end
100 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHNavigationController.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHNavigationController.h"
25 | #import "NSString+wikiHow.h"
26 | #import "WHArticleViewController.h"
27 | #import "WHImageViewController.h"
28 | #import "WHSearchViewController.h"
29 | #import "WHSurvivalKitViewController.h"
30 | #import "WHSurvivalKitCategoryViewController.h"
31 | #import "WHFeaturedViewController.h"
32 | #import "WHPreferenceViewController.h"
33 |
34 |
35 | @implementation WHNavigationController
36 |
37 | - (void)pushViewControllerWithIdentifier:(NSString *)identifier animated:(BOOL)animated {
38 | NSString *identifierNamespace = [identifier identifierNamespace];
39 | UIViewController *viewController;
40 | if ([identifierNamespace isEqualToString:@"Article"]) {
41 | viewController = [[WHArticleViewController alloc] initWithIdentifier:identifier];
42 | } else if ([identifierNamespace isEqualToString:@"SurvivalKit"]) {
43 | viewController = [[WHSurvivalKitCategoryViewController alloc] init];
44 | } else if ([identifierNamespace isEqualToString:@"Category"]) {
45 | viewController = [[WHSurvivalKitViewController alloc] initWithIdentifier:identifier];
46 | } else if ([identifierNamespace isEqualToString:@"Search"]) {
47 | viewController = [[WHSearchViewController alloc] initWithIdentifier:identifier];
48 | } else if ([identifierNamespace isEqualToString:@"Featured"]) {
49 | viewController = [[WHFeaturedViewController alloc] initWithIdentifier:identifier];
50 | } else if ([identifierNamespace isEqualToString:@"Image"]) {
51 | viewController = [[WHImageViewController alloc] initWithIdentifier:identifier];
52 | } else if ([identifierNamespace isEqualToString:@"Settings"]) {
53 | viewController = [[WHPreferenceViewController alloc] init];
54 | }
55 | [self pushViewController:viewController animated:animated];
56 | [viewController release];
57 | }
58 |
59 | - (NSMutableArray *)navigationLocation {
60 | NSMutableArray *location = [[[NSMutableArray alloc] init] autorelease];
61 | UIViewController *viewController;
62 | for (viewController in self.viewControllers) {
63 | if ([viewController respondsToSelector:@selector(identifier)]) {
64 | [location addObject:[viewController performSelector:@selector(identifier)]];
65 | } else {
66 | break;
67 | }
68 | }
69 | return location;
70 | }
71 |
72 | #pragma mark Handling Rotation
73 |
74 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
75 | return [[self visibleViewController] shouldAutorotateToInterfaceOrientation:interfaceOrientation];
76 | }
77 |
78 | @end
79 |
--------------------------------------------------------------------------------
/Classes/Libraries/XML/CXMLElement.m:
--------------------------------------------------------------------------------
1 | //
2 | // CXMLElement.m
3 | // TouchXML
4 | //
5 | // Created by Jonathan Wight on 03/07/08.
6 | // Copyright 2008 Toxic Software. All rights reserved.
7 | //
8 |
9 | #import "CXMLElement.h"
10 |
11 | #import "CXMLNode_PrivateExtensions.h"
12 |
13 | @implementation CXMLElement
14 |
15 | - (NSArray *)elementsForName:(NSString *)name
16 | {
17 | NSMutableArray *theElements = [NSMutableArray array];
18 |
19 | // TODO -- native xml api?
20 | const xmlChar *theName = (const xmlChar *)[name UTF8String];
21 |
22 | xmlNodePtr theCurrentNode = _node->children;
23 | while (theCurrentNode != NULL)
24 | {
25 | if (theCurrentNode->type == XML_ELEMENT_NODE && xmlStrcmp(theName, theCurrentNode->name) == 0)
26 | {
27 | CXMLNode *theNode = [CXMLNode nodeWithLibXMLNode:(xmlNodePtr)theCurrentNode];
28 | [theElements addObject:theNode];
29 | }
30 | theCurrentNode = theCurrentNode->next;
31 | }
32 | return(theElements);
33 | }
34 |
35 | //- (NSArray *)elementsForLocalName:(NSString *)localName URI:(NSString *)URI;
36 |
37 | - (NSArray *)attributes
38 | {
39 | NSMutableArray *theAttributes = [NSMutableArray array];
40 | xmlAttrPtr theCurrentNode = _node->properties;
41 | while (theCurrentNode != NULL)
42 | {
43 | CXMLNode *theAttribute = [CXMLNode nodeWithLibXMLNode:(xmlNodePtr)theCurrentNode];
44 | [theAttributes addObject:theAttribute];
45 | theCurrentNode = theCurrentNode->next;
46 | }
47 | return(theAttributes);
48 | }
49 |
50 | - (CXMLNode *)attributeForName:(NSString *)name
51 | {
52 | // TODO -- look for native libxml2 function for finding a named attribute (like xmlGetProp)
53 | const xmlChar *theName = (const xmlChar *)[name UTF8String];
54 |
55 | xmlAttrPtr theCurrentNode = _node->properties;
56 | while (theCurrentNode != NULL)
57 | {
58 | if (xmlStrcmp(theName, theCurrentNode->name) == 0)
59 | {
60 | CXMLNode *theAttribute = [CXMLNode nodeWithLibXMLNode:(xmlNodePtr)theCurrentNode];
61 | return(theAttribute);
62 | }
63 | theCurrentNode = theCurrentNode->next;
64 | }
65 | return(NULL);
66 | }
67 |
68 | //- (CXMLNode *)attributeForLocalName:(NSString *)localName URI:(NSString *)URI;
69 |
70 | //- (NSArray *)namespaces; //primitive
71 | //- (CXMLNode *)namespaceForPrefix:(NSString *)name;
72 | //- (CXMLNode *)resolveNamespaceForName:(NSString *)name;
73 | //- (NSString *)resolvePrefixForNamespaceURI:(NSString *)namespaceURI;
74 |
75 | - (NSString*)_XMLStringWithOptions:(NSUInteger)options appendingToString:(NSMutableString*)str
76 | {
77 | NSString* name = [self name];
78 | [str appendString:[NSString stringWithFormat:@"<%@", name]];
79 |
80 | for (id attribute in [self attributes] )
81 | {
82 | [attribute _XMLStringWithOptions:options appendingToString:str];
83 | }
84 |
85 | if ( ! _node->children )
86 | {
87 | bool isEmpty = NO;
88 | NSArray *emptyTags = [NSArray arrayWithObjects: @"br", @"area", @"link", @"img", @"param", @"hr", @"input", @"col", @"base", @"meta", nil ];
89 | for (id s in emptyTags)
90 | {
91 | if ( [s isEqualToString:@"base"] )
92 | {
93 | isEmpty = YES;
94 | NSLog(@"%@", s);
95 | break;
96 | }
97 | }
98 | if ( isEmpty )
99 | {
100 | [str appendString:@"/>"];
101 | return str;
102 | }
103 | }
104 |
105 | [str appendString:@">"];
106 |
107 | if ( _node->children )
108 | {
109 | for (id child in [self children])
110 | [child _XMLStringWithOptions:options appendingToString:str];
111 | }
112 | [str appendString:[NSString stringWithFormat:@"%@>", name]];
113 | return str;
114 | }
115 |
116 | - (NSString *)description
117 | {
118 | NSAssert(_node != NULL, @"TODO");
119 |
120 | return([NSString stringWithFormat:@"<%@ %p [%p] %@ %@>", NSStringFromClass([self class]), self, self->_node, [self name], [self XMLStringWithOptions:0]]);
121 | }
122 |
123 | @end
124 |
--------------------------------------------------------------------------------
/Classes/Helper/WHSearchXMLReader.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHSearchXMLReader.h"
25 | #import "GTMNSString+HTML.h"
26 |
27 |
28 | @implementation WHSearchXMLReader
29 |
30 | - (NSArray *)parseXMLData:(NSData *)XMLData parseError:(NSError **)error {
31 | _result = [[NSMutableArray alloc] init];
32 | NSXMLParser *parser = [[NSXMLParser alloc] initWithData:XMLData];
33 | [parser setDelegate:self];
34 | [parser setShouldProcessNamespaces:NO];
35 | [parser setShouldReportNamespacePrefixes:NO];
36 | [parser setShouldResolveExternalEntities:NO];
37 | [parser parse];
38 | NSError *parseError = [parser parserError];
39 | if (parseError && error) {
40 | *error = parseError;
41 | }
42 | [parser release];
43 | NSArray *result = [[_result copy] autorelease];
44 | [_result release];
45 | _result = nil;
46 | return result;
47 | }
48 |
49 | - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
50 | if (qName) {
51 | elementName = qName;
52 | }
53 |
54 | if ([elementName isEqualToString:@"R"]) {
55 | _article = [[NSMutableDictionary alloc] init];
56 | _contentOfElement = nil;
57 | } else if ([elementName isEqualToString:@"UE"]) {
58 | _contentOfElement = [[NSMutableString alloc] init];
59 | } else if ([elementName isEqualToString:@"T"]) {
60 | _contentOfElement = [[NSMutableString alloc] init];
61 | } else {
62 | _contentOfElement =nil;
63 | }
64 | }
65 |
66 | - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
67 | if (qName) {
68 | elementName = qName;
69 | }
70 | if ([elementName isEqualToString:@"R"]) {
71 | NSDictionary *articleCopy = [_article copy];
72 | [_result addObject:articleCopy];
73 | [articleCopy release];
74 | [_article release];
75 | _article = nil;
76 | } else if ([elementName isEqualToString:@"UE"]) {
77 | NSString *identifier = [NSString stringWithFormat:@"Article:%@", [[[NSURL URLWithString:_contentOfElement] path] substringFromIndex:1]];
78 | [_article setObject:identifier forKey:@"identifier"];
79 | [_contentOfElement release];
80 | _contentOfElement = nil;
81 | } else if ([elementName isEqualToString:@"T"]) {
82 | NSString *title = [_contentOfElement stringByReplacingOccurrencesOfString:@"" withString:@""];
83 | title = [title stringByReplacingOccurrencesOfString:@"" withString:@""];
84 | title = [title substringToIndex:[title length] - 10]; // remove " - wikiHow" suffix
85 | title = [title gtm_stringByUnescapingFromHTML];
86 | [_article setObject:title forKey:@"title"];
87 | [_contentOfElement release];
88 | _contentOfElement = nil;
89 | } else {
90 | _contentOfElement =nil;
91 | }
92 | }
93 |
94 | - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
95 | if (_contentOfElement) {
96 | [_contentOfElement appendString:string];
97 | }
98 | }
99 |
100 | @end
101 |
--------------------------------------------------------------------------------
/Classes/Libraries/SoundEffect/SoundEffect.m:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | File: SoundEffect.m
4 | Abstract: SoundEffect is a class that loads and plays sound files.
5 |
6 | Version: 1.6
7 |
8 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc.
9 | ("Apple") in consideration of your agreement to the following terms, and your
10 | use, installation, modification or redistribution of this Apple software
11 | constitutes acceptance of these terms. If you do not agree with these terms,
12 | please do not use, install, modify or redistribute this Apple software.
13 |
14 | In consideration of your agreement to abide by the following terms, and subject
15 | to these terms, Apple grants you a personal, non-exclusive license, under
16 | Apple's copyrights in this original Apple software (the "Apple Software"), to
17 | use, reproduce, modify and redistribute the Apple Software, with or without
18 | modifications, in source and/or binary forms; provided that if you redistribute
19 | the Apple Software in its entirety and without modifications, you must retain
20 | this notice and the following text and disclaimers in all such redistributions
21 | of the Apple Software.
22 | Neither the name, trademarks, service marks or logos of Apple Inc. may be used
23 | to endorse or promote products derived from the Apple Software without specific
24 | prior written permission from Apple. Except as expressly stated in this notice,
25 | no other rights or licenses, express or implied, are granted by Apple herein,
26 | including but not limited to any patent rights that may be infringed by your
27 | derivative works or by other works in which the Apple Software may be
28 | incorporated.
29 |
30 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
31 | WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
32 | WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33 | PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
34 | COMBINATION WITH YOUR PRODUCTS.
35 |
36 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
37 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
38 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 | ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR
40 | DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF
41 | CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
42 | APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2008 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import "SoundEffect.h"
49 |
50 | @implementation SoundEffect
51 |
52 | // Creates a sound effect object from the specified sound file
53 | + (id)soundEffectWithContentsOfFile:(NSString *)aPath {
54 | if (aPath) {
55 | return [[[SoundEffect alloc] initWithContentsOfFile:aPath] autorelease];
56 | }
57 | return nil;
58 | }
59 |
60 | // Initializes a sound effect object with the contents of the specified sound file
61 | - (id)initWithContentsOfFile:(NSString *)path {
62 | self = [super init];
63 |
64 | // Gets the file located at the specified path.
65 | if (self != nil) {
66 | NSURL *aFileURL = [NSURL fileURLWithPath:path isDirectory:NO];
67 |
68 | // If the file exists, calls Core Audio to create a system sound ID.
69 | if (aFileURL != nil) {
70 | SystemSoundID aSoundID;
71 | OSStatus error = AudioServicesCreateSystemSoundID((CFURLRef)aFileURL, &aSoundID);
72 |
73 | if (error == kAudioServicesNoError) { // success
74 | _soundID = aSoundID;
75 | } else {
76 | NSLog(@"Error %d loading sound at path: %@", error, path);
77 | [self release], self = nil;
78 | }
79 | } else {
80 | NSLog(@"NSURL is nil for path: %@", path);
81 | [self release], self = nil;
82 | }
83 | }
84 | return self;
85 | }
86 |
87 | // Releases resouces when no longer needed.
88 | -(void)dealloc {
89 | AudioServicesDisposeSystemSoundID(_soundID);
90 | [super dealloc];
91 | }
92 |
93 | // Plays the sound associated with a sound effect object.
94 | -(void)play {
95 | // Calls Core Audio to play the sound for the specified sound ID.
96 | AudioServicesPlaySystemSound(_soundID);
97 | }
98 |
99 | @end
100 |
--------------------------------------------------------------------------------
/Classes/Views/WHTableViewCell.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHTableViewCell.h"
25 | #import
26 |
27 | static float kCellMarginTop = 10.0;
28 | static float kCellMarginLeft = 10.0;
29 | static float kCellMarginBottom = 10.0;
30 | static float kCellMarginRight = 5.0;
31 | static float kCellMarginRightDisclosureIndicator = 24.0;
32 | static float kCellMarginRightIndex = 24.0;
33 |
34 | @implementation WHTableViewCell
35 |
36 | @synthesize isUsingIndex;
37 |
38 | - (id)init {
39 | if (self = [super init]) {
40 | isUsingIndex = NO;
41 | leftIndentation = 0;
42 | }
43 | return self;
44 | }
45 |
46 | - (void)dealloc {
47 | [icon release];
48 | [title release];
49 | [super dealloc];
50 | }
51 |
52 | - (UIImage *)icon {
53 | return icon;
54 | }
55 |
56 | - (void)setIcon:(UIImage *)img {
57 | if (icon != img) {
58 | [icon release];
59 | icon = [img retain];
60 | [self setNeedsDisplay];
61 | }
62 | }
63 |
64 | - (NSString *)title {
65 | return title;
66 | }
67 |
68 | - (void)setTitle:(NSString *)str {
69 | if (![title isEqualToString:str]) {
70 | [title release];
71 | title = [str copy];
72 | [self setNeedsDisplay];
73 | }
74 | }
75 |
76 | - (void)setEditing:(BOOL)editing animated:(BOOL)animated {
77 | if (editing == self.editing) {
78 | [super setEditing:editing animated:animated];
79 | } else {
80 | [super setEditing:editing animated:animated];
81 | leftIndentation = editing ? 30.0 : 0.0;
82 | if (animated) {
83 | [contentView setNeedsDisplay];
84 | CATransition *animation = [CATransition animation];
85 | [animation setType:kCATransitionFade];
86 | [animation setDuration:0.3];
87 | [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
88 | [[contentView layer] addAnimation:animation forKey:@"selectAnimation"];
89 | }
90 | }
91 | }
92 |
93 | - (void)drawContentView:(CGRect)r {
94 | CGContextRef context = UIGraphicsGetCurrentContext();
95 | UIColor *backgroundColor = [UIColor whiteColor];
96 | UIColor *textColor = [UIColor blackColor];
97 | if (self.selected) {
98 | backgroundColor = [UIColor clearColor];
99 | textColor = [UIColor whiteColor];
100 | }
101 | [backgroundColor set];
102 | CGRect backgroundRect = CGRectMake(0, 0, r.size.width, r.size.height);
103 | CGContextFillRect(context, backgroundRect);
104 |
105 | [textColor set];
106 | CGRect titleRect = CGRectMake(kCellMarginLeft + leftIndentation, 0, r.size.width - kCellMarginLeft - kCellMarginRight - leftIndentation, r.size.height - kCellMarginTop - kCellMarginBottom);
107 | if (icon) {
108 | titleRect.origin.x += r.size.height;
109 | titleRect.size.width -= r.size.height;
110 | [icon drawAtPoint:CGPointMake(0, 0)];
111 | }
112 | if (!self.editing) {
113 | if (self.accessoryType != UITableViewCellAccessoryNone) {
114 | titleRect.size.width -= kCellMarginRightDisclosureIndicator - kCellMarginRight;
115 | } else if (isUsingIndex) {
116 | titleRect.size.width -= kCellMarginRightIndex - kCellMarginRight;
117 | }
118 | }
119 | UIFont *titleFont = [UIFont boldSystemFontOfSize:20];
120 | CGSize titleSize = [title sizeWithFont:titleFont constrainedToSize:titleRect.size lineBreakMode:UILineBreakModeTailTruncation];
121 | titleRect.origin.y = (r.size.height - titleSize.height) / 2;
122 | [title drawInRect:titleRect withFont:[UIFont boldSystemFontOfSize:20] lineBreakMode:UILineBreakModeTailTruncation alignment:UITextAlignmentLeft];
123 | }
124 |
125 |
126 | @end
127 |
--------------------------------------------------------------------------------
/Classes/ViewControllers/WHSuggestionViewController.m:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2009 wikihow.com and Keishi Hattori
2 | //
3 | // Permission is hereby granted, free of charge, to any person
4 | // obtaining a copy of this software and associated documentation
5 | // files (the "Software"), to deal in the Software without
6 | // restriction, including without limitation the rights to use,
7 | // copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the
9 | // Software is furnished to do so, subject to the following
10 | // conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | // OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | #import "WHSuggestionViewController.h"
25 |
26 | #define WHSuggestionHistoryLimit 100
27 |
28 | @implementation WHSuggestionViewController
29 |
30 | @synthesize delegate;
31 |
32 | - (id)initWithStyle:(UITableViewStyle)style {
33 | if (self = [super initWithStyle:style]) {
34 | self.tableView.rowHeight = 36.0;
35 | NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
36 | history = [standardUserDefaults objectForKey:@"history"];
37 | if (!history) {
38 | history = [[NSMutableArray alloc] init];
39 | }
40 | result = [[NSMutableArray alloc] init];
41 | self.tableView.backgroundColor = [UIColor colorWithRed:0.93 green:0.93 blue:0.93 alpha:1.0];
42 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveHistory) name:UIApplicationWillTerminateNotification object:nil];
43 | }
44 | return self;
45 | }
46 |
47 | - (void)dealloc {
48 | [history release];
49 | [result release];
50 | [super dealloc];
51 | }
52 |
53 | - (void)saveHistory {
54 | NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];
55 | [standardUserDefaults setObject:history forKey:@"history"];
56 | }
57 |
58 | - (void)add:(NSString *)s {
59 | if ([history indexOfObject:s] == NSNotFound) {
60 | [history addObject:[s copy]];
61 | if ([history count] > WHSuggestionHistoryLimit) {
62 | [history removeLastObject];
63 | }
64 | }
65 | }
66 |
67 | - (void)suggestWithQuery:(NSString *)q {
68 | NSString *h;
69 | [result release];
70 | result = [[NSMutableArray alloc] init];
71 | if ([q length] != 0) {
72 | NSString *uppercaseQ = [q uppercaseString];
73 | for (h in history) {
74 | NSString *uppercaseH = [h uppercaseString];
75 | if ([uppercaseH hasPrefix:uppercaseQ] && ![uppercaseH isEqualToString:uppercaseQ]) {
76 | [result addObject:h];
77 | }
78 | }
79 | }
80 | [self.tableView reloadData];
81 | }
82 |
83 | #pragma mark Table view methods
84 |
85 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
86 | return 1;
87 | }
88 |
89 |
90 | // Customize the number of rows in the table view.
91 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
92 | self.tableView.hidden = ([result count] == 0);
93 | return [result count];
94 | }
95 |
96 |
97 | // Customize the appearance of table view cells.
98 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
99 |
100 | static NSString *CellIdentifier = @"SuggestionCell";
101 |
102 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
103 | if (cell == nil) {
104 | cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
105 | }
106 |
107 | cell.textLabel.text = [result objectAtIndex:([result count] - 1 - indexPath.row)];
108 | cell.textLabel.font = [UIFont boldSystemFontOfSize:16.0];
109 |
110 | return cell;
111 | }
112 |
113 |
114 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
115 | NSString *suggestion = [result objectAtIndex:([result count] - 1 - indexPath.row)];
116 | [history removeObject:suggestion];
117 | [history addObject:suggestion];
118 | if ([delegate respondsToSelector:@selector(didSelectSuggestion:)]) {
119 | [delegate performSelector:@selector(didSelectSuggestion:) withObject:suggestion];
120 | }
121 | }
122 |
123 |
124 | @end
125 |
126 |
--------------------------------------------------------------------------------
/Classes/Libraries/JSON/SBJSON.h:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 2008 Stig Brautaset. All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | Neither the name of the author nor the names of its contributors may be used
15 | to endorse or promote products derived from this software without specific
16 | prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #import
31 |
32 | extern NSString * SBJSONErrorDomain;
33 |
34 | enum {
35 | EUNSUPPORTED = 1,
36 | EPARSENUM,
37 | EPARSE,
38 | EFRAGMENT,
39 | ECTRL,
40 | EUNICODE,
41 | EDEPTH,
42 | EESCAPE,
43 | ETRAILCOMMA,
44 | ETRAILGARBAGE,
45 | };
46 |
47 | /**
48 | @brief A strict JSON parser and generator
49 |
50 | This is the parser and generator underlying the categories added to
51 | NSString and various other objects.
52 |
53 | Objective-C types are mapped to JSON types and back in the following way:
54 |
55 | @li NSNull -> Null -> NSNull
56 | @li NSString -> String -> NSMutableString
57 | @li NSArray -> Array -> NSMutableArray
58 | @li NSDictionary -> Object -> NSMutableDictionary
59 | @li NSNumber (-initWithBool:) -> Boolean -> NSNumber -initWithBool:
60 | @li NSNumber -> Number -> NSDecimalNumber
61 |
62 | In JSON the keys of an object must be strings. NSDictionary keys need
63 | not be, but attempting to convert an NSDictionary with non-string keys
64 | into JSON will throw an exception.
65 |
66 | NSNumber instances created with the +numberWithBool: method are
67 | converted into the JSON boolean "true" and "false" values, and vice
68 | versa. Any other NSNumber instances are converted to a JSON number the
69 | way you would expect. JSON numbers turn into NSDecimalNumber instances,
70 | as we can thus avoid any loss of precision.
71 |
72 | Strictly speaking correctly formed JSON text must have exactly
73 | one top-level container. (Either an Array or an Object.) Bare
74 | nulls, numbers, booleans and strings are not valid JSON on their own.
75 | It can be quite convenient to pretend that such fragments are valid
76 | JSON however. This class lets you do so.
77 |
78 | This class does its best to be as strict as possible, both in what it
79 | accepts and what it generates. (Other than the above mentioned support
80 | for JSON fragments.) For example, it does not support trailing commas
81 | in arrays or objects. Nor does it support embedded comments, or
82 | anything else not in the JSON specification.
83 |
84 | */
85 | @interface SBJSON : NSObject {
86 | // Attributes
87 | BOOL humanReadable;
88 | unsigned maxDepth;
89 |
90 | @private
91 | // Used temporarily during scanning/generation
92 | unsigned depth;
93 | const char *c;
94 | }
95 |
96 | /// Whether we are generating human-readable (multiline) JSON
97 | - (BOOL)humanReadable;
98 |
99 | /// Set whether to generate human-readable JSON or not
100 | - (void)setHumanReadable:(BOOL)y;
101 |
102 | /// The maximum depth the parser will go to
103 | - (unsigned)maxDepth;
104 |
105 | /// Set the maximum depth the parser will go to
106 | - (void)setMaxDepth:(unsigned)y;
107 |
108 | /// Return JSON representation of an array or dictionary
109 | - (NSString*)stringWithObject:(id)value error:(NSError**)error;
110 |
111 | /// Return JSON representation of any legal JSON value
112 | - (NSString*)stringWithFragment:(id)value error:(NSError**)error;
113 |
114 | /// Return the object represented by the given string
115 | - (id)objectWithString:(NSString*)jsonrep error:(NSError**)error;
116 |
117 | /// Return the fragment represented by the given string
118 | - (id)fragmentWithString:(NSString*)jsonrep error:(NSError**)error;
119 |
120 | @end
121 |
--------------------------------------------------------------------------------