categories

Accessing views from within NSTextField Category?

I've got several different classes in my code utilising identical methods -- resulting in a lot of duplicated lines -- and I recently found out about adding Categories which promises an effective solution to the problem. To give one of the smaller examples, my previous methods were (typically) called in the traditional way like this: if...

How to include the post-count of a category to link-item when listing categories?

Hello! How could I include the count of posts under a category into the a-tag when listing categories. This has been a problem for me many times but now I decided to find out. <li><a href="#" title="asd">php</a> (1)</li> to <li><a href="#" title="asd">php (1)</a></li> Is you propably assumed, I'm using wp_list_categories to make t...

Categories and Tagging in a Web Application

I'm creating a small trivia site and would like to know if anyone has insight as to how I could categorize the trivia questions/quizzes so that it does not hinder the "typical browse around and answer questions" type of user, as opposed to one who uses the search engine to explicitly find trivia of interest. Trivia content will be creat...

Objective-C categories: Can I add a property for a method not in my category?

I want to use a category to make a method on the original class available as a property as well. Class A: @interface ClassA - (NSString*)foo; @end Class A category @interface ClassA (Properties) - (void)someCategoryMethod; @property (nonatomic, readonly) NSString *foo; @end Now when I do this, it seems to work (EDIT: Maybe it does...

Objective-C categories in static library

Can you guide me how to properly link static library to iphone project. I use staic library project added to app project as direct dependency (target -> general -> direct dependecies) and all works OK, but categories. A category defined in static library is not working in app. So my question is how to add static library with some categ...

Downloading Amazon and eBay Product Categories

I'm new on a client project where the old offshore developer was fired by the client in a fit of anger and all I have is spaghetti code. Somehow the last developer was using developer APIs to get Amazon and eBay top-level product categories, but the developer stored them as static files (not even a timelimit cache file), and then elimina...

WordPress > Custom Category Listing by excluding Category Slug matches

I have a group of categories where the slug of each has a prefix "mycat-" and I would like to insert code into my sidebar.php file to create a custom sidebar widget that lists all categories except those preceeded by "mycat-". Any help much appreciated. Example Categories (by slug)... mycat-hidden, mycat-favorites, mycat-nofollow, myc...

Update category's parent via script wp_update_category() ?

I have several categories in which I need to update/assign the parent category so that the default category (uncategorized) becomes the parent. Its very easy to do this via the category manager, however, I need to do this via script. ...

How to loop through a specific category on single.php in Wordpress?

I've created a custom page and it is set as my homepage, within this custom page I am pulling out the latest post from a specific category, I've also created a form of pagination which when clicked upon will take the user to single.php. My intention for the single.php is to have two custom loops. Custom loop one I want single.php to dis...

How to filter Wordpress posts using a hook in a plugin?

I'm creating a Wordpress plugin and, being a newbie in the development on this platform, I'm stuck on this problem. I'd like to have posts in the loop filtered by categories, defined by the user through an admin page. I would actually like to be able to modify query_post() parameters in the plugin, but the only trick I found is to re-ru...

Does a Category applied to NSString also apply to NSCFString via the "toll-free bridge"?

We're integrating a library into an iPhone app which appears to use the google toolbox for iPhone internally. The google toolbox adds a method gtm_stringBySanitizingAndEscapingForXML to NSString. The problem is, whenever we attempt to make a call to this library we get [NSCFString gtm_stringBySanitizingAndEscapingForXML]: unrecognized ...

Can I add a custom method to Core Data-generated classes?

I've got a couple of Core Data-generated class files that I'd like to add custom methods to. I don't need to add any instance variables. How can I do this? I tried adding a category of methods: // ContactMethods.h (my category on Core Data-generated "Contact" class) #import "Contact.h" @interface Contact (ContactMethods) -(NSString*)di...

How do I use objc_setAssociatedObject/objc_getAssociatedObject inside an object?

If I use objc_setAssociatedObject/objc_getAssociatedObject inside a category implementation to store a simulated instance variable in a setter method, how would I access the key in the getter method since any variables declared in the setter method would be outside the scope of the getter method? Edit: To clarify, if I were to use the ...

Magento loadByAttribute for Custom Category Attributes

I have created custom attributes for a category in my module's install script like so: $attrib = array( 'type' => 'varchar', 'group' => 'My Data', 'backend' => '', 'frontend' => '', 'label' => 'My Custom Field', 'input' => 'text', 'class...

Least intensive way to find all nested subcategories using mysql query

I have a database in which items are placed into categories. Some of these categories are nested, so as an example: Animals > Birds > Parrots Animals > Birds > Penguin Animals > Mammals > Cats Animals > Mammals > Dogs Animals > Reptiles > Snakes Plants > Trees Plants > Flowers etc I have these in a table along the lines of ...

How to make categories and current page highlighting in PHP?

I am trying to find some example code or best practices about making CMS-type categories with PHP. This is a problem that has for sure been solved gazillion times but for some reason I am unable to find any example code using PHP about how to implement this. As far as I can tell, there are two parts to the problem. The first one has to...

How to run junit tests by category in maven

Using junit 4.8 and the new @Category annotations, is there a way to choose a subset of categories to run with maven's surefire plugin? For example I have: @Test public void a() { } @Category(SlowTests.class) @Test public void b() { } And I'd like to run all non-slow tests as in: (note that the -Dtest.categories was made up by me......

wordpress categories missing

Please note, this is not a theme or so issue. The categories are not showing in the admin panel, however it denotes that there is 6 categories. They are also visible in the databse. Recently something happened with the hosting and any php move_upload functions started giving error about missing tmp path, so i created a local php.ini fil...

Joomla / Virtuemart - How to display level 2 subcategories on virtuemart homepage?

Hi, I have a Joomla shop that stocks parts for cars. I am using the Virtuemart component to handle the shop aspect. The top parent categories for my products are; Air filters Oil filters Fuel filters Pollen filters This means that the virtuemart side menu displays these 4 options, which is fine. However, for the shop (virtuemart) home...

categories and items 1 big array

I've made some search on the forum without any good answers for my problem. If I missed something, feel free to link me to the question! What I need to do is simple: a function that returns an array of the full tree of my categories and items. I only have 1 depth (item and a cat_id), so no recursion involved (though if you have a recurs...